elif [ "${action}" = "put" ]; then
# Expand letsencrypt.tar to /etc/letsencrypt/ on server.
scp letsencrypt.tar plom@${server}:~/
- ssh -t plom@${server} 'su -c "rmdir /etc/letsencrypt && mv letsencrypt.tar /etc/ && cd /etc/ && tar xf letsencrypt.tar && rm letsencrypt.tar"'
+ ssh -t plom@${server} 'su -c "apt -y install certbot && rmdir /etc/letsencrypt && mv letsencrypt.tar /etc/ && cd /etc/ && tar xf letsencrypt.tar && rm letsencrypt.tar"'
else
echo "Action must be 'get', or 'put'."
false
--- /dev/null
+# This is only necessary when we use dovecot's LMTP mechanism to receive
+# mail from postfix.
+auth_username_format = %Ln
--- /dev/null
+# Add sieve filtering.
+protocol lmtp {
+ mail_plugins = $mail_plugins sieve
+}
group = postfix
}
}
+
+# We don't strictly need to provide a LMTP server to fetch mail from
+# postfix, but we do if we want to do sophisticated stuff like sieve
+# filtering on the way.
+service lmtp {
+ inet_listener lmtp {
+ address = 127.0.0.1
+ port = 2424
+ }
+}
# connect to opendkim
smtpd_milters = inet:localhost:12301
-non_smtpd_milters = inet:localhost:12301
\ No newline at end of file
+non_smtpd_milters = inet:localhost:12301
+
+# transport mail to dovecot; not strictly needed, as even without this
+# postfix will throw mail to /var/mail/USER to be found by dovecot for
+# serving via IMAP etc.; but using dovecot's LMTP server for delivery
+# allows us to do stuff like dovecot-side sieve filtering.
+mailbox_transport = lmtp:inet:127.0.0.1:2424
\ No newline at end of file
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