{"id":30986,"date":"2016-01-22T22:42:21","date_gmt":"2016-01-22T17:12:21","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=30986"},"modified":"2016-01-22T22:42:21","modified_gmt":"2016-01-22T17:12:21","slug":"configure-amazon-ses-with-exim","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/configure-amazon-ses-with-exim\/","title":{"rendered":"Configure Amazon SES with Exim"},"content":{"rendered":"<p>I have been working on different MTAs since the last couple of years. This time, the Exim4 use-case which I encountered was to sends emails using premium Email Service Provider.<\/p>\n<p><strong>Use-case<\/strong>: We were supposed to send thousands of emails like auto-reply emails or newsletters from our dedicated server(Ec2 machines) inside the private subnet.<\/p>\n<p>I chose\u00a0to use Amazon SES, a platform which provides transactional and cost-effective email service using your own email addresses and domains. Click on\u00a0<a href=\"https:\/\/aws.amazon.com\/ses\/\">link<\/a>\u00a0to learn more about AWS SES.<\/p>\n<p>Reasons why I chose SES:<\/p>\n<ul>\n<li>Reliability<\/li>\n<li>Cost<\/li>\n<li>Account Security<\/li>\n<li>Deliverability<\/li>\n<li>Scalability<\/li>\n<\/ul>\n<p><strong>Exim4<\/strong> is a general purpose mail package that is highly configurable and flexible. Refer this\u00a0<a href=\"http:\/\/www.exim.org\/\">link<\/a> to know more about Exim.<\/p>\n<p>Now, Let us configure the Exim4 with following steps:<\/p>\n<ul>\n<li><strong>Install the package\u00a0<\/strong><\/li>\n<\/ul>\n<p>[js]apt-get install exim4[\/js]<\/p>\n<ul>\n<li><strong>Configure the Exim<\/strong><\/li>\n<\/ul>\n<p>[js]sudo dpkg-reconfigure exim4-config[\/js]<\/p>\n<address style=\"padding-left: 60px\"><strong>Mail Server Configuration<\/strong><\/address>\n<address style=\"padding-left: 60px\">1) Mail configuration type as &#8220;internet site; mail is sent and received directly using SMTP&#8221;<\/address>\n<address style=\"padding-left: 60px\">2) Enter the system&#8217;s FQDN in the mail name configuration screen.<\/address>\n<address style=\"padding-left: 60px\">3) Enter\u00a0127.0.0.1 for listen address<\/address>\n<address style=\"padding-left: 60px\">4) and rest of the steps, take the default value.<\/address>\n<ul>\n<li><strong>Confirm if Exim process has started on port\u00a025 using below command.<\/strong><\/li>\n<\/ul>\n<p>[js]\u00a0sudo netstat -ntpl [\/js]<\/p>\n<p>&nbsp;<\/p>\n<p>Configuration of the AWS SES with Exim4 includes following steps:<\/p>\n<ul>\n<li>Verifying the domain or email address with SES. For more details, follow this <a href=\"http:\/\/docs.aws.amazon.com\/ses\/latest\/DeveloperGuide\/verify-domain-procedure.html\">link<\/a>.<\/li>\n<li>Create and download the SMTP credentials from AWS SES console. For more details follow this <a href=\"http:\/\/docs.aws.amazon.com\/ses\/latest\/DeveloperGuide\/smtp-credentials.html\">link<\/a>.<\/li>\n<li>Now make the following changes in\u00a0\/etc\/exim\/exim.conf<\/li>\n<\/ul>\n<address style=\"padding-left: 30px\">1) <span style=\"color: #ff9900\">In the routers section, add below lines:<\/span><\/address>\n<p>[js]send_via_ses:<br \/>\ndriver = manualroute<br \/>\ndomains = ! +local_domains<br \/>\ntransport = ses_smtp<br \/>\nroute_list = * email-smtp.us-east-1.amazonaws.com[\/js]<\/p>\n<address style=\"padding-left: 30px\">2)<span style=\"color: #ff9900\"> In the transports section, add these following lines:<\/span><\/address>\n<p>[js]ses_smtp:<br \/>\ndriver = smtp<br \/>\nport = 587<br \/>\nhosts_require_auth = $host_address<br \/>\nhosts_require_tls = $host_address[\/js]<\/p>\n<address style=\"padding-left: 30px\">3)<span style=\"color: #ff9900\">\u00a0In the authenticator\u00a0section, add these following lines:<\/span><\/address>\n<p>[js]ses_login:<br \/>\ndriver = plaintext<br \/>\npublic_name = LOGIN<br \/>\nclient_send = : xxUSER-NAME-xxxx : xxxxxxxPASSWORDxxxxxx[\/js]<\/p>\n<address style=\"padding-left: 30px\"><strong> Note:\u00a0Use SMTP username and password which were obtained in CSV file, not your AWS access key ID and secret access key.<\/strong><\/address>\n<address style=\"padding-left: 30px\">4) <span style=\"color: #ff9900\">Change existing line &#8220;public_name = LOGIN&#8221; to following:<\/span><\/address>\n<address style=\"padding-left: 30px\">\n<p>[js]public_name = OLD_LOGIN[\/js]<\/p>\n<\/address>\n<ul>\n<li>Restart the Exim service.<\/li>\n<\/ul>\n<p>[js]sudo service exim4 restart[\/js]<\/p>\n<ul>\n<li>Now, try sending a mail.<\/li>\n<\/ul>\n<p>[js]echo AWS-SES-MAIL | mail -r verfiyed-mail-address@from-ses-console.com -s TEST your-mail-address@example.com[\/js]<\/p>\n<ul>\n<li>For further debugging, please refer the log file.<\/li>\n<\/ul>\n<p>[js]tailf \/var\/log\/exim4\/mainlog[\/js]<\/p>\n<p>That&#8217;s all in this blog. If you face any issues don&#8217;t forget to share your feedback\u00a0down below. \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been working on different MTAs since the last couple of years. This time, the Exim4 use-case which I encountered was to sends emails using premium Email Service Provider. Use-case: We were supposed to send thousands of emails like auto-reply emails or newsletters from our dedicated server(Ec2 machines) inside the private subnet. I chose\u00a0to [&hellip;]<\/p>\n","protected":false},"author":120,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":51},"categories":[1174,2348],"tags":[1700,596,2914,1710,1699],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/30986"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/120"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=30986"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/30986\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=30986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=30986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=30986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}