home · contact · privacy
Remove logs overview.
[config] / all_new_2018 / setup_mail.sh
index d65f0a75295e4a334f8456fd702477f9c16a0e80..60eda3164151d63d8ffedf041186072defba7eb4 100755 (executable)
@@ -31,6 +31,7 @@ fi
 
 # Link and adapt mail-server-specific /etc/ files.
 ./hardlink_etc.sh mail
+sed -i "s/REPLACE_maildomain_ECALPER/${mail_domain}/g" /etc/mailutils.conf
 sed -i "s/REPLACE_Domain_ECALPER/${mail_domain}/g" /etc/opendkim.conf
 sed -i "s/REPLACE_Selector_ECALPER/${dkim_selector}/g" /etc/opendkim.conf
 sed -i "s/REPLACE_myhostname_ECALPER/$(hostname -f)/g" /etc/postfix/main.cf
@@ -39,6 +40,8 @@ if [ "${domainwide}" = "domainwide" ]; then
 else
     sed -i 's/REPLACE_mydomain_if_domainwide_ECALPER//g' /etc/postfix/main.cf
 fi
+# Since we re-set the iptables rules, we need to reload them.
+iptables-restore /etc/iptables/rules.v4
 
 # Some useful debconf selections.
 echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections
@@ -51,11 +54,16 @@ echo "ssl_key = </etc/letsencrypt/live/$(hostname -f)/privkey.pem" >> /etc/dovec
 echo "postfix postfix/mailname string ${mail_domain}" | debconf-set-selections
 echo "${mail_domain}" > /etc/mailname
 
-# Everything should now be ready for installations.
-apt install -y -o Dpkg::Options::=--force-confold postfix dovecot-imapd opendkim
+# Everything should now be ready for installations. Note that we don't
+# strictly need dovecot-lmtpd, as postfix will deliver mail to /var/mail/USER
+# in any case, to be found by dovecot; we use it as a transport mechanism to
+# allow for sophisticated stuff like dovecot-side sieve filtering (installed
+# with dovecot-sieve).
+apt install -y -o Dpkg::Options::=--force-confold postfix dovecot-imapd dovecot-lmtpd dovecot-sieve opendkim
 echo "TODO: Ensure MX entry for your system in your DNS configuration."
 echo "TODO: Ensure a proper SPF entry for this system in your DNS configuration; something like 'v=spf1 mx -all' mapped to your host."
 if [ "${add_dkim_record}" -eq "1" ]; then
     echo "TODO: Add the following DKIM entry to your DNS configuration (possibly with slightly changed host entry – if your mail domain includes a subdomain, append that with a dot):"
     cat "${dkim_selector}.txt"
 fi
+echo "TODO: passwd plom"