{"id":3139,"date":"2013-05-31T11:10:54","date_gmt":"2013-05-31T03:10:54","guid":{"rendered":"http:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/?p=3139"},"modified":"2013-05-31T13:42:25","modified_gmt":"2013-05-31T05:42:25","slug":"sendmail-smtp-auth","status":"publish","type":"post","link":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/?p=3139","title":{"rendered":"Sendmail smtp auth under CentOS 6"},"content":{"rendered":"<p>1.Get signed server certificate for auth<\/p>\n<p>2. edit sendmail.mc as below : (port 587 is listened by default, no need to add in the mc)<\/p>\n<pre style=\"padding-left: 30px;\">define(`confAUTH_OPTIONS', `A p y')dnl\r\n TRUST_AUTH_MECH(`LOGIN PLAIN')dnl\r\n define(`confAUTH_MECHANISMS', `LOGIN PLAIN')dnl\r\n define(`confCACERT_PATH',`\/etc\/pki\/tls\/certs')\r\n define(`confCACERT',`\/etc\/pki\/tls\/certs\/gd_bundle.crt')\r\n define(`confSERVER_CERT',`\/etc\/pki\/tls\/certs\/server.crt')\r\n define(`confSERVER_KEY',`\/etc\/pki\/tls\/certs\/server.key')\r\n DAEMON_OPTIONS(`Port=465,Addr=0.0.0.0, Name=MTA')<\/pre>\n<p>3. install saslauthd, make sure the below are installed :<\/p>\n<p style=\"padding-left: 30px;\">cyrus-sasl-plain<br \/>\ncyrus-sasl-devel<br \/>\ncyrus-sasl-lib<br \/>\ncyrus-sasl<\/p>\n<p>4. Check \/etc\/sysconfig\/saslauthd,\u00a0 should be as below :<\/p>\n<pre style=\"padding-left: 30px;\">MECH=pam\r\n# these two settings are the defaults\r\nSOCKETDIR=\/var\/run\/saslauthd\r\nFLAGS=<\/pre>\n<p>5. check \/etc\/sasl2\/Sendmail.conf, should be as below :<\/p>\n<pre style=\"padding-left: 30px;\">pwcheck_method:saslauthd<\/pre>\n<p>6. service saslauthd restart; service sendmail restart<\/p>\n<p>7. Use the command : <em>openssl s_client -starttls smtp -connect localhost:587<\/em> and then enter<br \/>\n<strong>EHLO localhost<\/strong> for debugging, you should see something as below :<\/p>\n<pre style=\"padding-left: 30px;\">EHLO localhost\r\n250-testhost.ie.cuhk.edu.hk Hello localhost [127.0.0.1], pleased to meet you\r\n250-ENHANCEDSTATUSCODES\r\n250-PIPELINING\r\n250-EXPN\r\n250-VERB\r\n250-8BITMIME\r\n250-SIZE 200000000\r\n250-DSN\r\n250-ETRN\r\n250-<strong><span style=\"color: #ff6600;\">AUTH LOGIN PLAIN<\/span><\/strong>\r\n250-DELIVERBY\r\n250 HELP<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.Get signed server certificate for auth<\/p>\n<p>2. edit sendmail.mc as below : (port 587 is listened by default, no need to add in the mc)<\/p>\n<p> define(`confAUTH_OPTIONS&#8217;, `A p y&#8217;)dnl TRUST_AUTH_MECH(`LOGIN PLAIN&#8217;)dnl define(`confAUTH_MECHANISMS&#8217;, `LOGIN PLAIN&#8217;)dnl define(`confCACERT_PATH&#8217;,`\/etc\/pki\/tls\/certs&#8217;) define(`confCACERT&#8217;,`\/etc\/pki\/tls\/certs\/gd_bundle.crt&#8217;) define(`confSERVER_CERT&#8217;,`\/etc\/pki\/tls\/certs\/server.crt&#8217;) define(`confSERVER_KEY&#8217;,`\/etc\/pki\/tls\/certs\/server.key&#8217;) DAEMON_OPTIONS(`Port=465,Addr=0.0.0.0, Name=MTA&#8217;) <\/p>\n<p>3. install saslauthd, make sure the below are installed :<\/p>\n<p style=\"padding-left: 30px;\">cyrus-sasl-plain cyrus-sasl-devel cyrus-sasl-lib [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[3],"tags":[64],"class_list":["post-3139","post","type-post","status-publish","format-standard","hentry","category-computer","tag-sendmail","odd"],"_links":{"self":[{"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3139"}],"version-history":[{"count":6,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3139\/revisions"}],"predecessor-version":[{"id":3141,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3139\/revisions\/3141"}],"wp:attachment":[{"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}