X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;f=all_new_2018%2Fsetup_scripts%2Fsetup_mail.sh;h=ab124b92d76ef1d61f29c1e5e5caafa20732252b;hb=67f74adea42ed093787c287342217c8f8bc9c878;hp=c8d4254dc20f9c924fb437334bb8f3d989ac1e24;hpb=eafecb0ed8c373dc4f33b6190375fdc3d5c4d841;p=config diff --git a/all_new_2018/setup_scripts/setup_mail.sh b/all_new_2018/setup_scripts/setup_mail.sh index c8d4254..ab124b9 100755 --- a/all_new_2018/setup_scripts/setup_mail.sh +++ b/all_new_2018/setup_scripts/setup_mail.sh @@ -64,6 +64,25 @@ echo "${mail_domain}" > /etc/mailname # 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 +cp "${config_tree_prefix}/user_files/dovecot.sieve" /home/plom/.dovecot.sieve +chown plom:plom /home/plom/.dovecot.sieve +cp "${config_tree_prefix}/user_files/pingmailrc" /home/plom/.pingmailrc +chown plom:plom /home/plom/.pingmailrc + +# In addition to our postfix server receiving mails, we funnel mails from a +# POP3 account into dovecot via fetchmail. It might make sense to adapt the +# ~/.dovecot.sieve to move mails targeted to the fetched mail account to their +# own mbox. +cp "${config_tree_prefix}/user_files/fetchmailrc" /home/plom/.fetchmailrc +chown plom:plom /home/plom/.fetchmailrc +chmod 0700 /home/plom/.fetchmailrc +set +e +apt install -y fetchmail +systemctl daemon-reload +systemctl start fetchmail.timer +set -e + +# Final advice to user. 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 @@ -71,3 +90,4 @@ if [ "${add_dkim_record}" -eq "1" ]; then cat "${dkim_selector}.txt" fi echo "TODO: passwd plom" +echo "TODO: adapt /home/plom/.dovecot.sieve /home/plom/.fetchmailrc /home/plom/.pingmailrc"