I'd like to start using Amazon SES for all emails from our server. We have a few freelance designers with PHP hosting, some Django/Python web apps and also some system utilities which send emails.
So I'd like to have PHP's mail function, the command line mail command and our python apps all be able to use it, preferably without having to set them all up in their own way.
I think what I need is to have something like Postfix running on localhost and using SES for it's delivery but I don't know how to do that.
Amazon's docs state I need to setup my mail transfer agent (MTA) so that it invokes the ses-send-email.pl script. I have the script but I'm not sure how to achieve this.
Am I on the right track? If so, how can I configure Postfix to use that script?
Here are some items copied from SES developer guide:
To integrate ses-send-email.pl with Postfix:
/etc/postfix
directory.Configure a new mail transport by adding the following two lines to the
master.cf
file, and then saving the file.Note the following about this example:
mailuser
is for illustrative purposes only.ses-send-email.pl
script and the credentials file reside in the /opt/third-party/amazon directory.You should modify these parameters as appropriate.
Open the main.cf file in the same directory as master.cf and modify it as follows:
Look for the default_transport line:
If it exists, change it so that it looks like this:
If it doesn't exist, then add a new line with the preceding content.
Restart your Postfix server.
Note that this command may not be exactly the same on your particular server. From this point on, your outgoing email is sent via Amazon SES.You can test this by sending an email message through your Postfix server, and then verifying that it arrives at its destination. If the message is not delivered, check your system's mail log for errors. On many systems, this is the
/var/log/mail.log
-- I created a simple blog put all things together I tried recently in Amazon Cloud and SES. Here is the link : http://netwiser.blogspot.com/2011/02/setup-amazon-ses-to-relay-email-by.html
Amazon just released SMTP access to SES. I whipped up a quick howto for it this morning: http://www.millcreeksys.com/2011/12/14/how-to-configure-your-postfix-server-to-relay-email-through-amazon-simple-email-service-ses/
Since you're hosting Python/Django apps on your server, you might find it preferable to hookup Postfix to the Python equivalent of the AWS Perl scripts. This guide has the details:
http://aws.amazon.com/articles/2405502737055650
Alternatively, if you want to use the Perl scripts but found (like me) that your CPAN modules are horribly out of date, an easier route may be to install the dependencies through your operating system's package manager. E.g., on ubuntu, you can do this with: