How To Use AWS SES With Sendmail In CentOS/Amazon Linux
Here are the Amazon docs: http://docs.amazonwebservices.com/ses/latest/DeveloperGuide/index.html?IntegratingWithServer.Sendmail.html
Edit sendmail.mc and generate a new sendmail.cf
1 2 3 4 5 6 7 8 9 |
# yum install sendmail-cf mailx # cd /etc/mail # cp sendmail.cf sendmail.cf.original # cp sendmail.mc sendmail.mc.original # vi sendmail.mc - Apply edits shown below # make -C /etc/mail # vi mailertable # makemap hash /etc/mail/mailertable < /etc/mail/mailertable # service sendmail restart |
/etc/mail/mailertable
.{TAB}aws-email:%0
Replace the {TAB} with an actual tab character, and the last character is a zero.
/etc/mail/sendmail.mc
Change:
DAEMON_OPTIONS(
Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
To:
dnl DAEMON_OPTIONS(
Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
Please note above the space after the leading ‘dnl’ and that there is a trailing ‘dnl’ as well.
Enable the following lines by removing the leading ‘dnl ‘ or add them as needed:
MASQUERADE_AS(
yourDomain.com')dnl
masquerade_envelope')dnl
FEATURE(
FEATURE(`mailertable')dnl
Add the following line, edited to match your installation:
Maws-email, P=/opt/aws/bin/ses-send-email.pl, F=mDFMuXn, U=smmsp, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, A=/opt/aws/bin/ses-send-email.pl -r -k /root/aws_credentials -e https://email.us-east-1.amazonaws.com -f $f $u
Anshul Johri said on November 24, 2011, 2:00 am:
Hi,
After following this I am getting Unknown mailer error 2
Any solution for that?