This Cookbook contains an that configures exim to SmartRelay to another SMTP server; as well as support SMTP Authentication so you can securely deploy a SMTP Server on Amazon EC2 to relay email via Sendgrid for example.
This cookbook removes ssmtp, and installs Exim and moves Exim's configuration files to the EBS for usage.
Modify main/recipes/default.rb and add
exim_auth “auth” do
my_hostname = "mywebsite.com" smtp_username = "user" smtp_password = "password" smtp_host = "smtp.sendgrid.com"
This Cookbook will create /data/exim on your EBS and then copy the Exim configuration files over to it if they are not there already, and then start exim. This allows you to modify and keep the exim.conf and the passwd file (if you choose to enable that) on the EBS which allows great customization.
This is the 'passwd' file for SMTP Authentication (clients connecting to Exim to relay out to your sendgrid account for example), it's format is very specific.
You need to use the sytem crypt() function to generate the cryptedpassword. Great example is passwd deploy and then grep deploy /etc/shadow
The hostname you want Exim to think it is. You can set this to your domain name so email appears to come from the same domain as your web site.
The Username you use to authenticate against on the Smarthost.
The Password you use to authenticate on the Smarthost.
The Smarthost IP or FQDN, (e.g. smtp.sendgrid.com)