Search code examples
ubuntuamazon-ec2amazon-web-servicespostfix-mtaamazon-ses

Sending Email from Drupal on AWS hosted on a Micro-EC2 through SES


So I followed the instructions here:

http://www.linnovate.net/blog/setup-postfix-work-amazon-ses

But I can't seam to get it to work :(

Here is my postfix log: http://dl.dropbox.com/u/14188709/mail.log

Anyone have some troubleshooting ideas for me?


Solution

  • The rather short instructions you referenced as well as the log you provided are suggesting that there might be several issues involved - I'd approach this as follows:

    • I'm assuming you've already setup Amazon SES as such, i.e. verified your email address(es) (required) and requested production access, if so desired already (optional; otherwise see Setting up Amazon SES)
    • Start from the original documentation on the subject matter, which already contains quite some required extra steps (e.g. related to the CA certificate and service startup etc.):

      • First step is Setting Up a Secure Tunnel

        • Please note that Postfix might not actually need this, because it provides a native TLS wrapper itself (see Enabling TLS in the Postfix SMTP server), see the respective SES note:

          Important

          Some MTAs have native support for TLS Wrapper, while others do not. Check the documentation for your mail server to determine whether it supports TLS Wrapper. If it supports TLS Wrapper, then you do not need to set up a secure tunnel.

          However, I haven't yet tried this myself and many people seem to simply run Postfix with SES and stunnel instead indeed.

      • Final step is Integrating Amazon SES with Postfix

    This should yield a fully working Postfix to SES via SMTP integration in principle; if it does not, you need to dig further and I think the AWS team responses on the forum thread Certificate issue on SES tunnel provide the best summary of what might go wrong, regardless of the apparently too constraint thread subject.

    • In addition, darignac's solution to his own issue might actually apply to a wider audience indeed:

      My ec2 machine is running Ubuntu 11.10 and I installed stunnel from the package manager (as this is usually the right way). This somehow does not work. I checked stunnel on another ec2 machine running the Amazon linux, it worked out of the box there. So I downloaded stunnel, compiled and installed by hand within Ubuntu. Had to create /usr/local/var/run/stunnel to enable stunnel to put its pidfile there. [...]

    Good luck!