{"id":2018,"date":"2014-10-27T11:18:03","date_gmt":"2014-10-27T11:18:03","guid":{"rendered":"http:\/\/blog.designed79.co.uk\/?p=2018"},"modified":"2014-11-10T14:24:51","modified_gmt":"2014-11-10T14:24:51","slug":"mac-os-x-server-configuring-outgoing-smtp-authentication-for-postfix","status":"publish","type":"post","link":"https:\/\/blog.designed79.co.uk\/?p=2018","title":{"rendered":"Mac OS X Server: Configuring outgoing SMTP authentication for postfix"},"content":{"rendered":"<header class=\"entry-header\"><strong>Note<\/strong> : \u00a0Your main.cf file maybe found\u00a0in\u00a0\/Library\/Server\/Mail\/Config\/postfix . \u00a0Server admin may look like its erroring but it&#8217;s really written to this file.<\/header>\n<header class=\"entry-header\">\n<p>More and more ISPs require customers to use the ISP\u2019s own SMTP server for sending mail (to effectively block spam coming from hijacked customer workstations). Or you simply might want to send outgoing mail using your own SMTP mail server somewhere in the Internet, which \u00a0should only accept encrypted, authenticated connection requests.<\/p>\n<p>If you\u2019re lucky, you can configure postfix on your Snow Leopard Server (and later) using the supplied \u2018Server Admin\u2019 GUI tool and enter your authentication credentials and the name of your (or your ISP\u2019s) SMTP server there. This is explained in the following Youtube video:\u00a0<b><a href=\"https:\/\/www.youtube.com\/watch?v=ussdq0jig6o\" target=\"_blank\">Using Your ISPs Mail Server in Snow Leopard Server<\/a>.<\/b><\/p>\n<p>In my case, this wasn\u2019t sufficient, i.e. didn\u2019t work and hence I had to use the CLI tool instead (which appears to be buggy, see later). The configuration of outgoing SMTP authentication for postfix on Mac OS X Snow Leopard Server is analogous to my quite old post\u00a0<a href=\"http:\/\/www.numlock.ch\/news\/it\/postfix-outgoingoutbound-smtp-authentication-for-smtphispeedchcablecomch\/\">about configuring SMTP auth for postfix on Linux<\/a>, only the commands slightly differ.<\/p>\n<p>Here are the commands I had to use:<\/p>\n<blockquote>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\"># serveradmin settings mail:postfix:smtp_sasl_mechanism_filter = &quot;plain&quot;<\/div><\/div>\n<p>mail:postfix:smtp_sasl_mechanism_filter = \u201cplain\u201d<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\"># serveradmin settings mail:postfix:smtp_sasl_security_options = &quot;noanonymous&quot;<\/div><\/div>\n<p>mail:postfix:smtp_sasl_security_options = \u201cnoanonymous\u201d<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\"># serveradmin settings mail:postfix:smtp_use_tls = &quot;yes&quot;<\/div><\/div>\n<p>mail:postfix:smtp_use_tls = \u201c1\u201d<\/p>\n<p>&nbsp;<\/p>\n<p>The last command reveals a bug in the \u2018serveradmin\u2019 tool which will prevent postfix from working correctly as the value is set to \u201c1\u201d instead of \u201cyes\u201d! As a workaround, you need to manually set the value to \u201cyes\u201d in \/etc\/postfix\/main.cf:<\/p>\n<p>&nbsp;<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\"># vi \/etc\/postfix\/main.cf<\/div><\/div>\n<p>smtp_use_tls = yes<\/p>\n<p>&nbsp;<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\"># vi \/etc\/postfix\/sasl\/passwd<\/div><\/div>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\"># cat \/etc\/postfix\/sasl\/passwd<\/div><\/div>\n<p>smtp.mydomain.com login:password<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\"># postmap hash:\/etc\/postfix\/sasl\/passwd<\/div><\/div>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\"># serveradmin stop mail<\/div><\/div>\n<p>mail:state = \u201cSTOPPED\u201d<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\"># serveradmin start mail<\/div><\/div>\n<p>mail:state = \u201cRUNNING\u201d<\/p><\/blockquote>\n<p>Done that, you can test the new settings by composing and sending a message using the \u2018mail\u2019 command:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\"># mail -s &quot;a test message&quot; myaddress@mydomain.com<\/div><\/div>\n<p>(enter the body text and finish editing the message by entering a dot on an empty line)<\/p>\n<p>Check the mail queue with<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\"># mailq<\/div><\/div>\n<p>Requeue messages that couldn\u2019t be delivered using<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\"># postqueue -f<\/div><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Note : \u00a0Your main.cf file maybe found\u00a0in\u00a0\/Library\/Server\/Mail\/Config\/postfix . \u00a0Server admin may look like its erroring but it&#8217;s really written to this file. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2018","post","type-post","status-publish","format-standard","hentry","category-info-on-tech"],"_links":{"self":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2018","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2018"}],"version-history":[{"count":0,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2018\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2018"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2018"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}