{"id":55,"date":"2008-06-06T17:32:00","date_gmt":"2008-06-06T14:32:00","guid":{"rendered":"http:\/\/www.held.org.il\/blog\/?p=55"},"modified":"2008-06-06T17:32:00","modified_gmt":"2008-06-06T14:32:00","slug":"configuring-sendmail-as-an-msa","status":"publish","type":"post","link":"http:\/\/www.held.org.il\/blog\/2008\/06\/configuring-sendmail-as-an-msa\/","title":{"rendered":"Configuring sendmail as an MSA"},"content":{"rendered":"<p><em>[Disclaimer: sendmail is very complicated, and I lack some knowledge. The following solution might be even bad, although it works (tm). Please post comments if you know better ways, and I'll update the post]<\/em><\/p>\n<p>I was looking for a quick n' simple SMTP solution for sending mails only. Requirements:<\/p>\n<ul>\n<li>A service that'll simply accept mails submitted <strong>locally<\/strong> and maintain a queue of mails-for-sending.<\/li>\n<li>It'll then send the mails by SMTP directly to the target servers (i.e. gmail.com).<\/li>\n<li>It should retry for a few days, if failed sending due to a local (dead connection) or remote problem.<\/li>\n<li>A bizarre one: it should be listening on a port <strong>other<\/strong> than 25, because another daemon uses it already. I know it's nonstandard and doesn't make sense, but should be possible..<\/li>\n<\/ul>\n<p>Apparently what I was looking for is an <a title=\"Wikipedia: Mail submission agent\" href=\"http:\/\/en.wikipedia.org\/wiki\/Mail_submission_agent\">Mail Submission Agent<\/a> (<a title=\"MSA RFC\" href=\"http:\/\/www.faqs.org\/rfcs\/rfc2476.html\">MSA<\/a>), which also takes care of delivering the mail. Also there's a standard port for mail submission: 587 (submission).<\/p>\n<p><!--more--><\/p>\n<p>I'm using CentOS 5, which comes by default with <a title=\"Sendmail\" href=\"http:\/\/www.sendmail.org\">sendmail<\/a>, so using the native service is an advantage.<\/p>\n<p>After some digging in sendmail docs, I've found that all my requirements could be met by changing 3 lines, based on the default configuration (<em>yum install sendmail-cf<\/em> to get it):<\/p>\n<p><span style=\"color: #808080;\"><strong>\/etc\/mail\/sendmail.mc:<\/strong><\/span><\/p>\n<ul>\n<li><strong>Added<\/strong> an MSA listener on port 'submission' (587):<br \/>\n<blockquote><p>DAEMON_OPTIONS(`Port=submission,Addr=127.0.0.1, Name=MSA')<\/p><\/blockquote>\n<\/li>\n<li><strong>Removed<\/strong> the following line to prevent MTA on port 25:<br \/>\n<blockquote><p>DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')<\/p><\/blockquote>\n<\/li>\n<\/ul>\n<p><strong><span style=\"color: #808080;\">\/etc\/mail\/submit.mc<\/span><\/strong><\/p>\n<ul>\n<li><strong>Added <\/strong>the following line to enable MSA mode:<\/li>\n<\/ul>\n<blockquote><p>FEATURE(`msp',\" \"FEATURE(`msp', `[127.0.0.1]', `MSA')<\/p><\/blockquote>\n<p><strong>The final part: <\/strong>\"Compiling\" sendmail's configuration<\/p>\n<blockquote><p>m4 \/etc\/mail\/submit.mc &gt; \/etc\/mail\/submit.cf<\/p>\n<p>m4 \/etc\/mail\/sendmail.mc &gt; \/etc\/mail\/sendmail.cf<\/p>\n<p>service sendmail restart<\/p><\/blockquote>\n<p>Viola.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[Disclaimer: sendmail is very complicated, and I lack some knowledge. The following solution might be even bad, although it works &#8482;. Please post comments if you know better ways, and I&#8217;ll update the post] I was looking for a quick n&#8217; simple SMTP solution for sending mails only. Requirements: A service that&#8217;ll simply accept mails [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[75],"tags":[203,77,100,106],"_links":{"self":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts\/55"}],"collection":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/comments?post=55"}],"version-history":[{"count":0,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts\/55\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/media?parent=55"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/categories?post=55"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/tags?post=55"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}