| Did this page help you? Yes No Tell us about it... |
To integrate ses-send-email.pl with Postfix
On your mail server, open the master.cf file. On many systems, this file resides in the /etc/postfix directory.
Configure a new mail transport: Add the following two lines to the master.cf file, modifying them to reflect your particular situation, and then save the file.
aws-email unix - n n - - pipe
flags=R user=mailuser argv=/opt/third-party/amazon/ses-send-email.pl -r -k /opt/third-party/amazon/aws-credentials -e https://email.us-east-1.amazonaws.com -f ${sender} ${recipient}Note the following about these lines:
The flags line begins with at least one space.
The user parameter must specify a non-root user (i.e., a nonadministrative user). The user "mailuser" in the previous example is for illustrative purposes only.
The ses-send-email.pl script and the credentials file reside on your mail server in the /opt/third-party/amazon directory.
The endpoint for communicating with Amazon SES is always https://email.us-east-1.amazonaws.com.
Open the main.cf file in the same directory as master.cf.
Look for the default_transport line. If it exists, modify it as follows. If it doesn't exist, add the following line.
default_transport = aws-email
When you are done, save the file.
Restart Postfix. At the command line, type the following command and press ENTER.
sudo /etc/init.d/postfix restart
![]() | Note |
|---|---|
This command may not be exactly the same on your particular server. |
From this point on, your outgoing email is sent via Amazon SES. To verify that this change was successful, send an email message through your Postfix server, and then verify that it arrives at its destination. If the message is not delivered, check your system's mail log for errors. On many systems, the log file is /var/log/mail.log.