pinkeen.postfix-relay

Installs and sets up Postfix to send emails to an external service like Mailgun, Mailchimp, or SendGrid.

In my opinion, using local Postfix as a buffer for emails is usually better than using the service's API or sending SMTP directly from the app, but your experience may vary.

Currently, it supports only one email relay, but Postfix can handle email routing based on the envelope from host (relayhostsby), which should be easy to modify.

Variables:

  • postfix_relay_host
  • postfix_relay_username
  • postfix_relay_password
  • postfix_relay_port

Notes on Multi-Host Email Routing

In the main.cf file, add:

sender_dependent_relayhost_maps = hash:/etc/postfix/relayhostsby

In the /etc/postfix/relayhostsby file, you can specify:

@fromhost1 [someotherexternalservice]
@fromhost2 [smtp.mandrillapp.com]:587
@fromhost3 [smtp.mandrillapp.com]:587

In the /etc/postfix/sasl_passwd file, set up your credentials:

@fromhost1 hostuser:hostpass
@fromhost2 mandrilluser:mandrillpass
@fromhost3 mandrilluser:mandrillpass

Additional Options to Solve Common Issues:

sender_dependent_relayhost_maps = hash:/etc/postfix/relayhostsby
smtp_sender_dependent_authentication = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_auth_enable = yes
smtp_use_tls = yes
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
smtp_tls_security_level = may
smtpd_tls_received_header = yes
tls_random_source = dev:/dev/urandom
smtpd_tls_security_level = may
smtp_use_tls = yes
smtp_sasl_security_options = noanonymous
Informazioni sul progetto

Configure postfix as relay

Installa
ansible-galaxy install pinkeen.postfix-relay
Licenza
Unknown
Download
5.8k
Proprietario
All things science, tech, people. Solving problems as a programmer, server guy and photographer.