You are viewing an old revision of this post, from January 13, 2016 @ 08:49:48 [Autosave]. See below for differences between this version and the current revision.

How to integrate Amazon SES with Postfix

A. First method: Postfix was created as an alternative to the widely used Sendmail MTA. For information about Postfix, go tohttp://www.postfix.org. These instructions were tested on a 64-bit Amazon EC2 instance using the following Amazon Machine Image (AMI), which is based on Red Hat:
  • Amazon Linux AMI 2014.09.2 (HVM) (ami-146e2a7c).
To launch an Amazon EC2 instance, which includes selecting an AMI, see Amazon Machine Images (AMIs). Prerequisites Before you perform one of the following procedures, verify the following:
  • You have uninstalled Sendmail (if you are not sure how to switch between Sendmail and Postfix).
  • You have installed Postfix.
  • You are able to successfully send an email using Postfix without Amazon SES.
  • You have verified your "From" address and, if your account is still in the sandbox, you have also verified your "To" addresses. For more information, see Verifying Email Addresses in Amazon SES.
  • (Optional) If you are sending email through Amazon SES from an Amazon EC2 instance, you may need to assign an Elastic IP Address to your Amazon EC2 instance for the receiving ISP to accept your email. For more information, see Amazon EC2 Elastic IP Addresses.
  • (Optional) If you are sending email through Amazon SES from an Amazon EC2 instance, you can fill out aRequest to Remove Email Sending Limitations to remove the additional sending limit restrictions that are applied to port 25 by default.

To configure integration with the Amazon SES US West (Oregon) endpoint using STARTTLS

  1. On your mail server, open the main.cf file. On many systems, this file resides in the /etc/postfix folder.

    Important

    These instructions assume that you want to use Amazon SES in the US West (Oregon) AWS region. If you want to use a different region, replace all instances of email-smtp.us-west-2.amazonaws.com in these instructions with the SMTP endpoint of the desired region. For a list of SMTP endpoints, see Regions and Amazon SES.
  2. Add the following lines to the main.cf file.
    
    relayhost = [email-smtp.us-west-2.amazonaws.com]:25
    smtp_sasl_auth_enable = yes
    smtp_sasl_security_options = noanonymous
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
    smtp_use_tls = yes
    smtp_tls_security_level = encrypt
    smtp_tls_note_starttls_offer = yes
    Save and close the main.cf file.
  3. On your mail server, open the master.cf file. On many systems, this file resides in the /etc/postfix folder.
  4. Comment out the following line of the master.cf file by putting a # in front of it: -o smtp_fallback_relay=Save and close the master.cf file.
  5. Edit the /etc/postfix/sasl_passwd file. If the file does not exist, create it. Add the following lines to the file, replacing USERNAME and PASSWORD with your SMTP user name and password. If Postfix cannot authenticate with the Amazon SES SMTP endpoint because the hostname does not match, try adding the additional line specified in Amazon SES SMTP Issues.

    Important

    Use your SMTP user name and password, not your AWS access key ID and secret access key. Your SMTP credentials and your AWS credentials are not the same. For information about how to obtain your SMTP credentials, see Obtaining Your Amazon SES SMTP Credentials.
    [email-smtp.us-west-2.amazonaws.com]:25 USERNAME:PASSWORD
    Save and close the sasl_passwd file.
  6. At a command prompt, issue the following command to create a hashmap database file containing your SMTP credentials.sudo postmap hash:/etc/postfix/sasl_passwd
  7. (Optional but recommended) Remove the /etc/postfix/sasl_passwd file.
  8. (Optional but recommended) The /etc/postfix/sasl_passwd and /etc/postfix/sasl_passwd.db files you created in the previous steps are not encrypted. Because these files contain your SMTP credentials, it is a good idea to use the following commands to change the owner to root and set permissions to restrict access to the files as much as possible. (Note that if you deleted /etc/postfix/sasl_passwd in the previous step, you should omit it from the commands below.)sudo chown root:root /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db sudo chmod 0600 /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
  9. Tell Postfix where to find the CA certificate (needed to verify the Amazon SES server certificate). You could use a self-signed certificate or you could use default certificates as follows:If running on the Amazon Linux AMI: sudo postconf -e 'smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt' If running on Ubuntu Linux: sudo postconf -e 'smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt'
  10. When you have finished updating the configuration, stop and start Postfix by typing the following at the command line:sudo postfix stop sudo postfix start
  11. Send a test email by typing the following at a command line, pressing Enter after each line. Note that you must replace [email protected] with your "From" email address, which you must have previously verified with Amazon SES. Replace [email protected] with your "To" address. If your account is still in the sandbox, the "To" address must also be verified. Also note that the final line is a single period.sendmail -f [email protected] [email protected] From: [email protected] Subject: Test This email was sent through Amazon SES! .
  12. Check your inbox for the email. If the message was not delivered, check your Junk box, and then check your system's mail log (typically /var/log/maillog) for errors. For example, you will get an "Email address not verified" error if you have not verified the "From" address that follows "-f" on the command line.
After following the above instruction, you need to change the sender email address for sending emails. Please read this topic to know to do: http://www.gentotech.net/wiki/postfix-change-sender-in-sending-messages/    
B. Second method.
To configure integration using a secure tunnel
  1. To begin, you will need to set up a secure tunnel as described in Setting Up a Secure Tunnel to Connect to Amazon SES. In the following procedure, we use port 2525 as your stunnel port. If you are using a different port, modify the settings that you actually use accordingly.
  2. On your mail server, open the main.cf file. On many systems, this file resides in the /etc/postfix folder.
  3. Add the following lines to the main.cf file.
    relayhost = 127.0.0.1:2525
    smtp_sasl_auth_enable = yes
    smtp_sasl_security_options = noanonymous
    smtp_tls_security_level = may
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
    Save and close the main.cf file.
  4. On your mail server, open the master.cf file. On many systems, this file resides in the /etc/postfix folder.
  5. Comment out the following line of the master.cf file by putting a # in front of it: -o smtp_fallback_relay=Save and close the master.cf file.
  6. Edit the /etc/postfix/sasl_passwd file. If the file does not exist, create it. Add the following line to the file, replacing USERNAME and PASSWORD with your SMTP user name and password.

    Important

    Use your SMTP user name and password, not your AWS access key ID and secret access key. Your SMTP credentials and your AWS credentials are not the same. For information about how to obtain your SMTP credentials, see Obtaining Your Amazon SES SMTP Credentials.
    127.0.0.1:2525 USERNAME:PASSWORD
    Save the sasl_passwd file.
  7. At a command prompt, issue the following command to create a hashmap database file containing your SMTP credentials.sudo postmap hash:/etc/postfix/sasl_passwd
  8. (Optional but recommended) Remove the /etc/postfix/sasl_passwd file.
  9. (Optional but recommended) The /etc/postfix/sasl_passwd and /etc/postfix/sasl_passwd.db files you created in the previous steps are not encrypted. Because these files contain your SMTP credentials, it is a good idea to use the following commands to change the owner to root and set permissions to restrict access to the files as much as possible. (Note that if you deleted /etc/postfix/sasl_passwd in the previous step, you should omit it from the commands below.)sudo chown root:root /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db sudo chmod 0600 /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
  10. When you have finished updating the configuration, stop and start Postfix by typing the following at the command line:sudo postfix stop sudo postfix start
  11. Send a test email by typing the following at a command line, pressing Enter after each line. Note that you must replace [email protected] with your "From" email address, which you must have previously verified with Amazon SES. Replace [email protected] with your "To" address. If your account is still in the sandbox, the "To" address must also be verified. Also note that the final line is a single period.sendmail -f [email protected] [email protected] From: [email protected] Subject: Test This email was sent through Amazon SES! .
  12. Check your inbox for the email. If the message was not delivered, check your Junk box, and then check your system's mail log (typically /var/log/maillog) for errors. For example, you will get an "Email address not verified" error if you have not verified the "From" address that follows "-f" on the command line.

Revisions

Revision Differences

January 13, 2016 @ 08:49:48 [Autosave]Current Revision
Content
Unchanged: A. First method:Unchanged: A. First method:
Unchanged: Postfix was created as an alternative to the widely used Sendmail MTA. For information about Postfix, go to<a class="ulink" href="http:// www.postfix.org/" target="_blank" >http://www.postfix.org</a>.Unchanged: Postfix was created as an alternative to the widely used Sendmail MTA. For information about Postfix, go to<a class="ulink" href="http:// www.postfix.org/" target="_blank" >http://www.postfix.org</a>.
Unchanged: These instructions were tested on a 64-bit Amazon EC2 instance using the following Amazon Machine Image (AMI), which is based on Red Hat:Unchanged: These instructions were tested on a 64-bit Amazon EC2 instance using the following Amazon Machine Image (AMI), which is based on Red Hat:
Unchanged: <div class="itemizedlist">Unchanged: <div class="itemizedlist">
Unchanged: <ul class="itemizedlist" type="disc">Unchanged: <ul class="itemizedlist" type="disc">
Unchanged: <li class="listitem">Amazon Linux AMI 2014.09.2 (HVM) (ami-146e2a7c).</li>Unchanged: <li class="listitem">Amazon Linux AMI 2014.09.2 (HVM) (ami-146e2a7c).</li>
Unchanged: </ul>Unchanged: </ul>
Unchanged: </div>Unchanged: </div>
Unchanged: To launch an Amazon EC2 instance, which includes selecting an AMI, see <a class="ulink" href="http:// docs.aws.amazon.com/AWSEC2/ latest/UserGuide/ec2-launch- instance_linux.html" target="_blank">Amazon Machine Images (AMIs)</a>.Unchanged: To launch an Amazon EC2 instance, which includes selecting an AMI, see <a class="ulink" href="http:// docs.aws.amazon.com/AWSEC2/ latest/UserGuide/ec2-launch- instance_linux.html" target="_blank">Amazon Machine Images (AMIs)</a>.
Unchanged: <span class="bold"> <strong>Prerequisites< /strong></span>Unchanged: <span class="bold"> <strong>Prerequisites< /strong></span>
Unchanged: Before you perform one of the following procedures, verify the following:Unchanged: Before you perform one of the following procedures, verify the following:
Unchanged: <div class="itemizedlist">Unchanged: <div class="itemizedlist">
Unchanged: <ul class="itemizedlist" type="disc">Unchanged: <ul class="itemizedlist" type="disc">
Unchanged: <li class="listitem">You have uninstalled Sendmail (if you are not sure how to switch between Sendmail and Postfix).</li>Unchanged: <li class="listitem">You have uninstalled Sendmail (if you are not sure how to switch between Sendmail and Postfix).</li>
Unchanged: <li class="listitem">You have installed Postfix.</li>Unchanged: <li class="listitem">You have installed Postfix.</li>
Unchanged: <li class="listitem">You are able to successfully send an email using Postfix without Amazon SES.</li>Unchanged: <li class="listitem">You are able to successfully send an email using Postfix without Amazon SES.</li>
Unchanged: <li class="listitem">You have verified your "From" address and, if your account is still in the sandbox, you have also verified your "To" addresses. For more information, see <a class="xref" title="Verifying Email Addresses in Amazon SES" href="http:// docs.aws.amazon.com/ses/latest/ DeveloperGuide/ verify-email- addresses.html">Verifying Email Addresses in Amazon SES</a>.</li>Unchanged: <li class="listitem">You have verified your "From" address and, if your account is still in the sandbox, you have also verified your "To" addresses. For more information, see <a class="xref" title="Verifying Email Addresses in Amazon SES" href="http:// docs.aws.amazon.com/ses/latest/ DeveloperGuide/ verify-email- addresses.html">Verifying Email Addresses in Amazon SES</a>.</li>
Unchanged: <li class="listitem">(Optional) If you are sending email through Amazon SES from an Amazon EC2 instance, you may need to assign an Elastic IP Address to your Amazon EC2 instance for the receiving ISP to accept your email. For more information, see <a class="ulink" href="http:// aws.amazon.com/ articles/1346" target="_blank">Amazon EC2 Elastic IP Addresses</a>.</li>Unchanged: <li class="listitem">(Optional) If you are sending email through Amazon SES from an Amazon EC2 instance, you may need to assign an Elastic IP Address to your Amazon EC2 instance for the receiving ISP to accept your email. For more information, see <a class="ulink" href="http:// aws.amazon.com/ articles/1346" target="_blank">Amazon EC2 Elastic IP Addresses</a>.</li>
Unchanged: <li class="listitem">(Optional) If you are sending email through Amazon SES from an Amazon EC2 instance, you can fill out a<a class="ulink" href="https:/ /aws-portal.amazon.com/gp/ aws/html-forms-controller/ contactus/ec2- email-limit- rdns-request" target="_blank">Request to Remove Email Sending Limitations</a> to remove the additional sending limit restrictions that are applied to port 25 by default.</li>Unchanged: <li class="listitem">(Optional) If you are sending email through Amazon SES from an Amazon EC2 instance, you can fill out a<a class="ulink" href="https:/ /aws-portal.amazon.com/gp/ aws/html-forms-controller/ contactus/ec2- email-limit- rdns-request" target="_blank">Request to Remove Email Sending Limitations</a> to remove the additional sending limit restrictions that are applied to port 25 by default.</li>
Unchanged: </ul>Unchanged: </ul>
Unchanged: </div>Unchanged: </div>
Unchanged: <div class="procedure">Unchanged: <div class="procedure">
Unchanged: <p class="title"><b>To configure integration with the Amazon SES US West (Oregon) endpoint using STARTTLS</b></p>Unchanged: <p class="title"><b>To configure integration with the Amazon SES US West (Oregon) endpoint using STARTTLS</b></p>
Unchanged: <ol class="procedure" type="1">Unchanged: <ol class="procedure" type="1">
Unchanged: <li class="step">On your mail server, open the <span class="emphasis" ><em>main.cf</em></span> file. On many systems, this file resides in the<span class="emphasis"><em> /etc/postfix</em></span> folder.Unchanged: <li class="step">On your mail server, open the <span class="emphasis" ><em>main.cf</em></span> file. On many systems, this file resides in the<span class="emphasis"><em> /etc/postfix</em></span> folder.
Unchanged: <div class="aws-note">Unchanged: <div class="aws-note">
Unchanged: <p class="aws-note" >Important</p>Unchanged: <p class="aws-note" >Important</p>
Unchanged: These instructions assume that you want to use Amazon SES in the US West (Oregon) AWS region. If you want to use a different region, replace all instances of <span class="emphasis" ><em>email-smtp.us- west-2.amazonaws.com</em></span> in these instructions with the SMTP endpoint of the desired region. For a list of SMTP endpoints, see <a class="xref" title="Regions and Amazon SES" href="http:// docs.aws.amazon.com/ses/latest/ DeveloperGuide/ regions.html">Regions and Amazon SES</a>.</div></li>Unchanged: These instructions assume that you want to use Amazon SES in the US West (Oregon) AWS region. If you want to use a different region, replace all instances of <span class="emphasis" ><em>email-smtp.us- west-2.amazonaws.com</em></span> in these instructions with the SMTP endpoint of the desired region. For a list of SMTP endpoints, see <a class="xref" title="Regions and Amazon SES" href="http:// docs.aws.amazon.com/ses/latest/ DeveloperGuide/ regions.html">Regions and Amazon SES</a>.</div></li>
Unchanged: <li class="step">Add the following lines to the <span class="emphasis" ><em>main.cf</em></span> file.Unchanged: <li class="step">Add the following lines to the <span class="emphasis" ><em>main.cf</em></span> file.
Unchanged: <pre class="programlisting"><code class="nohighlight">Unchanged: <pre class="programlisting"><code class="nohighlight">
Unchanged: relayhost = [email-smtp.us- west-2.amazonaws.com]:25Unchanged: relayhost = [email-smtp.us- west-2.amazonaws.com]:25
Unchanged: smtp_sasl_auth_enable = yesUnchanged: smtp_sasl_auth_enable = yes
Unchanged: smtp_sasl_security_options = noanonymousUnchanged: smtp_sasl_security_options = noanonymous
Unchanged: smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwdUnchanged: smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
Unchanged: smtp_use_tls = yesUnchanged: smtp_use_tls = yes
Unchanged: smtp_tls_security_level = encryptUnchanged: smtp_tls_security_level = encrypt
Unchanged: smtp_tls_note_ starttls_offer = yes</code></pre>Unchanged: smtp_tls_note_ starttls_offer = yes</code></pre>
Unchanged: Save and close the <span class="emphasis" ><em>main.cf</em></span> file.</li>Unchanged: Save and close the <span class="emphasis" ><em>main.cf</em></span> file.</li>
Unchanged: <li class="step">On your mail server, open the <span class="emphasis" ><em>master.cf</em></span> file. On many systems, this file resides in the<span class="emphasis"><em> /etc/postfix</em></span> folder.</li>Unchanged: <li class="step">On your mail server, open the <span class="emphasis" ><em>master.cf</em></span> file. On many systems, this file resides in the<span class="emphasis"><em> /etc/postfix</em></span> folder.</li>
Unchanged: <li class="step">Comment out the following line of the <span class="emphasis" ><em>master.cf</em></span> file by putting a # in front of it: <code class="code">-o smtp_fallback_ relay=</code>Save and close the <span class="emphasis" ><em>master.cf</em></span> file.</li>Unchanged: <li class="step">Comment out the following line of the <span class="emphasis" ><em>master.cf</em></span> file by putting a # in front of it: <code class="code">-o smtp_fallback_ relay=</code>Save and close the <span class="emphasis" ><em>master.cf</em></span> file.</li>
Unchanged: <li class="step">Edit the <span class="emphasis" ><em>/etc/postfix/ sasl_passwd</em></span> file. If the file does not exist, create it. Add the following lines to the file, replacing <span class="emphasis" ><em>USERNAME</em></span> and <span class="emphasis" ><em>PASSWORD</em></span> with your SMTP user name and password. If Postfix cannot authenticate with the Amazon SES SMTP endpoint because the hostname does not match, try adding the additional line specified in <a class="xref" title="Amazon SES SMTP Issues" href="http:// docs.aws.amazon.com/ses/latest/ DeveloperGuide/ smtp-issues.html">Amazon SES SMTP Issues</a>.Unchanged: <li class="step">Edit the <span class="emphasis" ><em>/etc/postfix/ sasl_passwd</em></span> file. If the file does not exist, create it. Add the following lines to the file, replacing <span class="emphasis" ><em>USERNAME</em></span> and <span class="emphasis" ><em>PASSWORD</em></span> with your SMTP user name and password. If Postfix cannot authenticate with the Amazon SES SMTP endpoint because the hostname does not match, try adding the additional line specified in <a class="xref" title="Amazon SES SMTP Issues" href="http:// docs.aws.amazon.com/ses/latest/ DeveloperGuide/ smtp-issues.html">Amazon SES SMTP Issues</a>.
Unchanged: <div class="aws-note">Unchanged: <div class="aws-note">
Unchanged: <p class="aws-note" >Important</p>Unchanged: <p class="aws-note" >Important</p>
Unchanged: Use your SMTP user name and password, not your AWS access key ID and secret access key. Your SMTP credentials and your AWS credentials are not the same. For information about how to obtain your SMTP credentials, see <a class="xref" title="Obtaining Your Amazon SES SMTP Credentials" href="http:// docs.aws.amazon.com/ses/latest/ DeveloperGuide/ smtp-credentials.html">Obtaining Your Amazon SES SMTP Credentials</a>.</div>Unchanged: Use your SMTP user name and password, not your AWS access key ID and secret access key. Your SMTP credentials and your AWS credentials are not the same. For information about how to obtain your SMTP credentials, see <a class="xref" title="Obtaining Your Amazon SES SMTP Credentials" href="http:// docs.aws.amazon.com/ses/latest/ DeveloperGuide/ smtp-credentials.html">Obtaining Your Amazon SES SMTP Credentials</a>.</div>
Unchanged: <pre class="programlisting"><code class="nohighlight" >[email-smtp.us- west-2.amazonaws.com]:25 USERNAME:PASSWORD< /code></pre>Unchanged: <pre class="programlisting"><code class="nohighlight" >[email-smtp.us- west-2.amazonaws.com]:25 USERNAME:PASSWORD< /code></pre>
Unchanged: Save and close the <span class="emphasis" ><em>sasl_passwd</em></span> file.</li>Unchanged: Save and close the <span class="emphasis" ><em>sasl_passwd</em></span> file.</li>
Unchanged: <li class="step">At a command prompt, issue the following command to create a hashmap database file containing your SMTP credentials.<code class="code">sudo postmap hash:/etc/postfix/ sasl_passwd</code></li>Unchanged: <li class="step">At a command prompt, issue the following command to create a hashmap database file containing your SMTP credentials.<code class="code">sudo postmap hash:/etc/postfix/ sasl_passwd</code></li>
Unchanged: <li class="step">(Optional but recommended) Remove the <span class="emphasis" ><em>/etc/postfix/ sasl_passwd</em></span> file.</li>Unchanged: <li class="step">(Optional but recommended) Remove the <span class="emphasis" ><em>/etc/postfix/ sasl_passwd</em></span> file.</li>
Unchanged: <li class="step">(Optional but recommended) The <span class="emphasis" ><em>/etc/postfix/ sasl_passwd</em></span> and <span class="emphasis" ><em>/etc/postfix/ sasl_passwd.db</em></span> files you created in the previous steps are not encrypted. Because these files contain your SMTP credentials, it is a good idea to use the following commands to change the owner to root and set permissions to restrict access to the files as much as possible. (Note that if you deleted <span class="emphasis" ><em>/etc/postfix/ sasl_passwd</em></span> in the previous step, you should omit it from the commands below.)<code class="code">sudo chown root:root /etc/postfix/sasl_passwd /etc/postfix/ sasl_passwd.db</code>Unchanged: <li class="step">(Optional but recommended) The <span class="emphasis" ><em>/etc/postfix/ sasl_passwd</em></span> and <span class="emphasis" ><em>/etc/postfix/ sasl_passwd.db</em></span> files you created in the previous steps are not encrypted. Because these files contain your SMTP credentials, it is a good idea to use the following commands to change the owner to root and set permissions to restrict access to the files as much as possible. (Note that if you deleted <span class="emphasis" ><em>/etc/postfix/ sasl_passwd</em></span> in the previous step, you should omit it from the commands below.)<code class="code">sudo chown root:root /etc/postfix/sasl_passwd /etc/postfix/ sasl_passwd.db</code>
Unchanged: <code class="code">sudo chmod 0600 /etc/postfix/sasl_passwd /etc/postfix/ sasl_passwd.db</code></li>Unchanged: <code class="code">sudo chmod 0600 /etc/postfix/sasl_passwd /etc/postfix/ sasl_passwd.db</code></li>
Unchanged: <li class="step">Tell Postfix where to find the CA certificate (needed to verify the Amazon SES server certificate). You could use a self-signed certificate or you could use default certificates as follows:If running on the Amazon Linux AMI:Unchanged: <li class="step">Tell Postfix where to find the CA certificate (needed to verify the Amazon SES server certificate). You could use a self-signed certificate or you could use default certificates as follows:If running on the Amazon Linux AMI:
Unchanged: <code class="code">sudo postconf -e 'smtp_tls_CAfile = /etc/ssl/certs/ ca-bundle.crt'</code>Unchanged: <code class="code">sudo postconf -e 'smtp_tls_CAfile = /etc/ssl/certs/ ca-bundle.crt'</code>
Unchanged: If running on Ubuntu Linux:Unchanged: If running on Ubuntu Linux:
Unchanged: <code class="code">sudo postconf -e 'smtp_tls_CAfile = /etc/ssl/certs/ ca-certificates.crt'</code></li>Unchanged: <code class="code">sudo postconf -e 'smtp_tls_CAfile = /etc/ssl/certs/ ca-certificates.crt'</code></li>
Unchanged: <li class="step">When you have finished updating the configuration, stop and start Postfix by typing the following at the command line:<code class="code">sudo postfix stop</code>Unchanged: <li class="step">When you have finished updating the configuration, stop and start Postfix by typing the following at the command line:<code class="code">sudo postfix stop</code>
Unchanged: <code class="code">sudo postfix start</code></li>Unchanged: <code class="code">sudo postfix start</code></li>
Unchanged: <li class="step">Send a test email by typing the following at a command line, pressing Enter after each line. Note that you must replace <span class="emphasis" ><em>[email protected]</em></span> with your "From" email address, which you must have previously verified with Amazon SES. Replace <span class="emphasis" ><em>[email protected]</em></span> with your "To" address. If your account is still in the sandbox, the "To" address must also be verified. Also note that the final line is a single period.<code class="code">sendmail -f [email protected] [email protected]</code>Unchanged: <li class="step">Send a test email by typing the following at a command line, pressing Enter after each line. Note that you must replace <span class="emphasis" ><em>[email protected]</em></span> with your "From" email address, which you must have previously verified with Amazon SES. Replace <span class="emphasis" ><em>[email protected]</em></span> with your "To" address. If your account is still in the sandbox, the "To" address must also be verified. Also note that the final line is a single period.<code class="code">sendmail -f [email protected] [email protected]</code>
Unchanged: <code class="code">From: [email protected]</code>Unchanged: <code class="code">From: [email protected]</code>
Unchanged: <code class="code">Subject: Test</code>Unchanged: <code class="code">Subject: Test</code>
Unchanged: <code class="code">This email was sent through Amazon SES!</code>Unchanged: <code class="code">This email was sent through Amazon SES!</code>
Unchanged: <code class="code"> .</code></li>Unchanged: <code class="code"> .</code></li>
Unchanged: <li class="step">Check your inbox for the email. If the message was not delivered, check your Junk box, and then check your system's mail log (typically <span class="emphasis" ><em>/var/log/ maillog</em></span>) for errors. For example, you will get an "Email address not verified" error if you have not verified the "From" address that follows "-f" on the command line.</li>Unchanged: <li class="step">Check your inbox for the email. If the message was not delivered, check your Junk box, and then check your system's mail log (typically <span class="emphasis" ><em>/var/log/ maillog</em></span>) for errors. For example, you will get an "Email address not verified" error if you have not verified the "From" address that follows "-f" on the command line.</li>
Unchanged: </ol>Unchanged: </ol>
Unchanged: </div>Unchanged: </div>
Unchanged: After following the above instruction, you need to change the sender email address for sending emails. Please read this topic to know to do:Unchanged: After following the above instruction, you need to change the sender email address for sending emails. Please read this topic to know to do:
 Added: http://www.gentotech.net/ wiki/postfix- change-sender- in-sending-messages/
 Added: &nbsp;
Unchanged: &nbsp;Unchanged: &nbsp;
Unchanged: <div class="procedure">Unchanged: <div class="procedure">
Unchanged: <strong>B. Second method.</strong></div>Unchanged: <strong>B. Second method.</strong></div>
Unchanged: <b>To configure integration using a secure tunnel</b>Unchanged: <b>To configure integration using a secure tunnel</b>
Unchanged: <ol class="procedure" type="1">Unchanged: <ol class="procedure" type="1">
Unchanged: <li class="step">To begin, you will need to set up a secure tunnel as described in <a class="xref" title="Setting Up a Secure Tunnel to Connect to Amazon SES" href="http:// docs.aws.amazon.com/ses/latest/ DeveloperGuide/send-email- smtp-secure-tunnel.html">Setting Up a Secure Tunnel to Connect to Amazon SES</a>. In the following procedure, we use port 2525 as your <span class="emphasis" ><em>stunnel</em></span> port. If you are using a different port, modify the settings that you actually use accordingly.</li>Unchanged: <li class="step">To begin, you will need to set up a secure tunnel as described in <a class="xref" title="Setting Up a Secure Tunnel to Connect to Amazon SES" href="http:// docs.aws.amazon.com/ses/latest/ DeveloperGuide/send-email- smtp-secure-tunnel.html">Setting Up a Secure Tunnel to Connect to Amazon SES</a>. In the following procedure, we use port 2525 as your <span class="emphasis" ><em>stunnel</em></span> port. If you are using a different port, modify the settings that you actually use accordingly.</li>
Unchanged: <li class="step">On your mail server, open the <span class="emphasis" ><em>main.cf</em></span> file. On many systems, this file resides in the<span class="emphasis"><em> /etc/postfix</em></span> folder.</li>Unchanged: <li class="step">On your mail server, open the <span class="emphasis" ><em>main.cf</em></span> file. On many systems, this file resides in the<span class="emphasis"><em> /etc/postfix</em></span> folder.</li>
Unchanged: <li class="step">Add the following lines to the <span class="emphasis" ><em>main.cf</em></span> file.Unchanged: <li class="step">Add the following lines to the <span class="emphasis" ><em>main.cf</em></span> file.
Unchanged: <pre class="programlisting"><code class="nohighlight">relayhost = 127.0.0.1:2525Unchanged: <pre class="programlisting"><code class="nohighlight">relayhost = 127.0.0.1:2525
Unchanged: smtp_sasl_auth_enable = yesUnchanged: smtp_sasl_auth_enable = yes
Unchanged: smtp_sasl_security_options = noanonymousUnchanged: smtp_sasl_security_options = noanonymous
Unchanged: smtp_tls_security_level = mayUnchanged: smtp_tls_security_level = may
Unchanged: smtp_sasl_password_maps = hash:/etc/postfix/ sasl_passwd</code></pre>Unchanged: smtp_sasl_password_maps = hash:/etc/postfix/ sasl_passwd</code></pre>
Unchanged: Save and close the <span class="emphasis" ><em>main.cf</em></span> file.</li>Unchanged: Save and close the <span class="emphasis" ><em>main.cf</em></span> file.</li>
Unchanged: <li class="step">On your mail server, open the <span class="emphasis" ><em>master.cf</em></span> file. On many systems, this file resides in the<span class="emphasis"><em> /etc/postfix</em></span> folder.</li>Unchanged: <li class="step">On your mail server, open the <span class="emphasis" ><em>master.cf</em></span> file. On many systems, this file resides in the<span class="emphasis"><em> /etc/postfix</em></span> folder.</li>
Unchanged: <li class="step">Comment out the following line of the <span class="emphasis" ><em>master.cf</em></span> file by putting a # in front of it: <code class="code">-o smtp_fallback_ relay=</code>Save and close the <span class="emphasis" ><em>master.cf</em></span> file.</li>Unchanged: <li class="step">Comment out the following line of the <span class="emphasis" ><em>master.cf</em></span> file by putting a # in front of it: <code class="code">-o smtp_fallback_ relay=</code>Save and close the <span class="emphasis" ><em>master.cf</em></span> file.</li>
Unchanged: <li class="step">Edit the <span class="emphasis" ><em>/etc/postfix/ sasl_passwd</em></span> file. If the file does not exist, create it. Add the following line to the file, replacing <span class="emphasis" ><em>USERNAME</em></span> and <span class="emphasis" ><em>PASSWORD</em></span> with your SMTP user name and password.Unchanged: <li class="step">Edit the <span class="emphasis" ><em>/etc/postfix/ sasl_passwd</em></span> file. If the file does not exist, create it. Add the following line to the file, replacing <span class="emphasis" ><em>USERNAME</em></span> and <span class="emphasis" ><em>PASSWORD</em></span> with your SMTP user name and password.
Unchanged: <div class="aws-note">Unchanged: <div class="aws-note">
Unchanged: <p class="aws-note" >Important</p>Unchanged: <p class="aws-note" >Important</p>
Unchanged: Use your SMTP user name and password, not your AWS access key ID and secret access key. Your SMTP credentials and your AWS credentials are not the same. For information about how to obtain your SMTP credentials, see <a class="xref" title="Obtaining Your Amazon SES SMTP Credentials" href="http:// docs.aws.amazon.com/ses/latest/ DeveloperGuide/ smtp-credentials.html">Obtaining Your Amazon SES SMTP Credentials</a>.</div>Unchanged: Use your SMTP user name and password, not your AWS access key ID and secret access key. Your SMTP credentials and your AWS credentials are not the same. For information about how to obtain your SMTP credentials, see <a class="xref" title="Obtaining Your Amazon SES SMTP Credentials" href="http:// docs.aws.amazon.com/ses/latest/ DeveloperGuide/ smtp-credentials.html">Obtaining Your Amazon SES SMTP Credentials</a>.</div>
Unchanged: <pre class="programlisting"><code class="nohighlight" >127.0.0.1:2525 USERNAME:PASSWORD< /code></pre>Unchanged: <pre class="programlisting"><code class="nohighlight" >127.0.0.1:2525 USERNAME:PASSWORD< /code></pre>
Unchanged: Save the <span class="emphasis" ><em>sasl_passwd</em></span> file.</li>Unchanged: Save the <span class="emphasis" ><em>sasl_passwd</em></span> file.</li>
Unchanged: <li class="step">At a command prompt, issue the following command to create a hashmap database file containing your SMTP credentials.<code class="code">sudo postmap hash:/etc/postfix/ sasl_passwd</code></li>Unchanged: <li class="step">At a command prompt, issue the following command to create a hashmap database file containing your SMTP credentials.<code class="code">sudo postmap hash:/etc/postfix/ sasl_passwd</code></li>
Unchanged: <li class="step">(Optional but recommended) Remove the <span class="emphasis" ><em>/etc/postfix/ sasl_passwd</em></span> file.</li>Unchanged: <li class="step">(Optional but recommended) Remove the <span class="emphasis" ><em>/etc/postfix/ sasl_passwd</em></span> file.</li>
Unchanged: <li class="step">(Optional but recommended) The <span class="emphasis" ><em>/etc/postfix/ sasl_passwd</em></span> and <span class="emphasis" ><em>/etc/postfix/ sasl_passwd.db</em></span> files you created in the previous steps are not encrypted. Because these files contain your SMTP credentials, it is a good idea to use the following commands to change the owner to root and set permissions to restrict access to the files as much as possible. (Note that if you deleted <span class="emphasis" ><em>/etc/postfix/ sasl_passwd</em></span> in the previous step, you should omit it from the commands below.)<code class="code">sudo chown root:root /etc/postfix/sasl_passwd /etc/postfix/ sasl_passwd.db</code>Unchanged: <li class="step">(Optional but recommended) The <span class="emphasis" ><em>/etc/postfix/ sasl_passwd</em></span> and <span class="emphasis" ><em>/etc/postfix/ sasl_passwd.db</em></span> files you created in the previous steps are not encrypted. Because these files contain your SMTP credentials, it is a good idea to use the following commands to change the owner to root and set permissions to restrict access to the files as much as possible. (Note that if you deleted <span class="emphasis" ><em>/etc/postfix/ sasl_passwd</em></span> in the previous step, you should omit it from the commands below.)<code class="code">sudo chown root:root /etc/postfix/sasl_passwd /etc/postfix/ sasl_passwd.db</code>
Unchanged: <code class="code">sudo chmod 0600 /etc/postfix/sasl_passwd /etc/postfix/ sasl_passwd.db</code></li>Unchanged: <code class="code">sudo chmod 0600 /etc/postfix/sasl_passwd /etc/postfix/ sasl_passwd.db</code></li>
Unchanged: <li class="step">When you have finished updating the configuration, stop and start Postfix by typing the following at the command line:<code class="code">sudo postfix stop</code>Unchanged: <li class="step">When you have finished updating the configuration, stop and start Postfix by typing the following at the command line:<code class="code">sudo postfix stop</code>
Unchanged: <code class="code">sudo postfix start</code></li>Unchanged: <code class="code">sudo postfix start</code></li>
Unchanged: <li class="step">Send a test email by typing the following at a command line, pressing Enter after each line. Note that you must replace <span class="emphasis" ><em>[email protected]</em></span> with your "From" email address, which you must have previously verified with Amazon SES. Replace <span class="emphasis" ><em>[email protected]</em></span> with your "To" address. If your account is still in the sandbox, the "To" address must also be verified. Also note that the final line is a single period.<code class="code">sendmail -f [email protected] [email protected]</code>Unchanged: <li class="step">Send a test email by typing the following at a command line, pressing Enter after each line. Note that you must replace <span class="emphasis" ><em>[email protected]</em></span> with your "From" email address, which you must have previously verified with Amazon SES. Replace <span class="emphasis" ><em>[email protected]</em></span> with your "To" address. If your account is still in the sandbox, the "To" address must also be verified. Also note that the final line is a single period.<code class="code">sendmail -f [email protected] [email protected]</code>
Unchanged: <code class="code">From: [email protected]</code>Unchanged: <code class="code">From: [email protected]</code>
Unchanged: <code class="code">Subject: Test</code>Unchanged: <code class="code">Subject: Test</code>
Unchanged: <code class="code">This email was sent through Amazon SES!</code>Unchanged: <code class="code">This email was sent through Amazon SES!</code>
Unchanged: <code class="code"> .</code></li>Unchanged: <code class="code"> .</code></li>
Unchanged: <li class="step">Check your inbox for the email. If the message was not delivered, check your Junk box, and then check your system's mail log (typically <span class="emphasis" ><em>/var/log/ maillog</em></span>) for errors. For example, you will get an "Email address not verified" error if you have not verified the "From" address that follows "-f" on the command line.</li>Unchanged: <li class="step">Check your inbox for the email. If the message was not delivered, check your Junk box, and then check your system's mail log (typically <span class="emphasis" ><em>/var/log/ maillog</em></span>) for errors. For example, you will get an "Email address not verified" error if you have not verified the "From" address that follows "-f" on the command line.</li>
Unchanged: </ol>Unchanged: </ol>

Note: Spaces may be added to comparison text to allow better line wrapping.

No comments yet.

Leave a Reply