Amazon SES with Sendmail as Relay

Over and over, sendmail keeps getting whacked out of configuration and it’s puzzling why this keeps happening. I followed everything at Amazon SES’ instruction here with no luck.

So to set things straight once for all, here are the steps to make the changes permanent.

  1. Open up typically located at /etc/mail
  2. Add FEATURE(`mailertable’)dnl below where all the FEATURE() codes are
  3. Add the lines below at the end of file
    • MAILER_DEFINITIONS Maws-email, P=/etc/aws/, F=mDFMuXn, U=mail, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, -r -k /etc/aws/aws-credentials -e -f $f $u
  4. Save the file
  5. Generate by doing m4 /etc/mail/ > /etc/mail/
  6. Open up mailertable typically located in /etc/mail and add .[TAB]aws-email:%0. Replace [TAB] with a real TAB character
  7. Build the mailertable database by doing makemap hash /etc/mail/mailertable < /etc/mail/mailertable
  8. Test the configuration by doing sendmail -bv
  9. If all goes well, restart sendmail by doing /etc/init.d/sendmail restart