Mandril integration with Exim MTA
Hubs are configured to send and receive email directly. However depending on server configuration, some mail servers on the internet may view an email message sent by your hub as SPAM. This can happen for a variety of reasons, ranging from partially setup machines used in development environments, servers that do not have DNS names properly established, MTAs that are not properly configured, etc.
Often you can find and fix specific issues it can help save your hub's email from your users' SPAM folders, but sometimes in cloud environments, your server is assigned an IP address from a pool of addresses where a previous user has used an IP addresses in that range to SPAM in the past, so your IP address itself of your server is blacklisted by various SPAM tracking software packages.
Often using a third party email provider such as Amazon SES or Mandrill can help rescue your outgoing email from your users' SPAM folders. This is an especially important issue for hubs that even occasionally send legitimate mass email to their users.
Setup an account with Mandrill. The free tier of service from Mandrill will allow for up to 12000 email per month with no charges.
Mandril Integration with Postfix
- Add the following lines to your /etc/postfix/main.cf:
# Mandril setup
# enable SASL authentication
smtp_sasl_auth_enable = yes
# tell Postfix where the credentials are storedrelayhost = [smtp.mandrillapp.com]:587
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
- Go to your Mandrill App homepage, select 'Settings' from the left hand column.
Create a new API Key for your server. Make note of the API Key you created as well as the SMTP credentials at the top of the page.
Create a file called /etc/postfix/sasl_passwd with the following contents:
[smtp.mandrillapp.com]:587 <SMTP Username>:<API Key>
Run: postmap /etc/postfix/sasl_passwd
Restart postfix: /etc/init.d/postfix restart
Note: For even more security, you might also want to setup DKIM and SPF on the host. On Mandril's page, go to 'Settings'->'Domain' Tab. Once you have sent an email or two through Mandrill's system, your server should appear in this list. You'll need to add several DNS TXT records, as well as have Mandrill deliver an email to a local account on your server, there will be a verify link in the email you must vist.
Contact your group's system administrator for details on adding DNS entires for this setup. For the verification email, you can send an email to the root user on your server, then look in the /var/mail/root file. You might need to enable postfix to deliver mail to root.