Mercurial > code > home > repos > infra
diff mail.py @ 184:53b6457f75f3
also config postfix on bang (others, soon)
author | drewp@bigasterisk.com |
---|---|
date | Mon, 27 Mar 2023 17:14:58 -0700 |
parents | 4cab03eb492e |
children | 087b84e68765 |
line wrap: on
line diff
--- a/mail.py Mon Mar 27 17:13:37 2023 -0700 +++ b/mail.py Mon Mar 27 17:14:58 2023 -0700 @@ -15,7 +15,7 @@ 'postmap /etc/postfix/aliases', 'postfix reload', ]) - systemd.service(service='postfix.service', enabled=True, running=True) + systemd.service(service='postfix@-.service', enabled=True, running=True) # maybe needs 'postfix@-.service', unclear # something to run ~drewp/mbsync/go at startup @@ -27,6 +27,22 @@ # other machines, route mail to bang or prime for delivery if host.name == 'bang': + apt.packages(packages=['postfix']) + files.template(src='templates/mail/main.cf.j2', dest='/etc/postfix/main.cf') + files.template(src='templates/mail/mydestination.j2', dest='/etc/postfix/mydestination') + files.put(src='secrets/mail/aliases', dest='/etc/postfix/aliases') + files.put(src='secrets/mail/sender_access', dest='/etc/postfix/sender_access') + files.put(src='secrets/mail/virtual', dest='/etc/postfix/virtual') + server.shell(commands=[ - "cd /my/serv/dovecot; invoke certs", + 'postmap /etc/postfix/sender_access', + 'postmap /etc/postfix/virtual', + 'postmap /etc/postfix/aliases', + 'postfix reload', ]) + systemd.service(service='postfix@-.service', enabled=True, running=True) + + # server.shell(commands=[ + # # not working + # "cd /my/serv/dovecot; runuser -u drewp -- invoke certs", + # ])