{"id":798,"date":"2012-08-28T04:10:43","date_gmt":"2012-08-28T10:10:43","guid":{"rendered":"http:\/\/jaredrobinson.com\/blog\/?p=798"},"modified":"2012-09-06T02:07:18","modified_gmt":"2012-09-06T08:07:18","slug":"postfix-on-ubuntu-12-04","status":"publish","type":"post","link":"https:\/\/jaredrobinson.com\/blog\/postfix-on-ubuntu-12-04\/","title":{"rendered":"Postfix on Ubuntu 12.04 with Comcast"},"content":{"rendered":"<p>After having had Ubuntu 12.04 installed for months, I finally moved my old Fedora services over to it, including Postfix. Here&#8217;s how I configured it.<\/p>\n<p>I configured \/etc\/aliases so that local email destined for &#8216;root&#8217; (including regularly scheduled system cron jobs) is delivered to my local account, instead of being sent to root@comcast.net (they don&#8217;t appreciate getting my SPAM):<\/p>\n<pre>root: myusername@localhost<\/pre>\n<p>I added the following to \/etc\/postfix\/main.cf. Notice that I appended a &#8220;.NOT&#8221; to the relayhost. I did this initially so that I could send test email messages, and make sure message delivery was correct, before allowing email to go to my ISP. More on this later.<\/p>\n<pre>alias\\_maps = hash:\/etc\/aliases\r\nalias\\_database = hash:\/etc\/aliases\r\nmyorigin = \/etc\/mailname\r\nmydestination = $myhostname, localhost.$mydomain, localhost, robinson-lin\r\nrelayhost = [smtp.comcast.net.NOT]:587\r\nsmtp\\_sasl\\_auth\\_enable = yes\r\nsmtp\\_sasl\\_password\\_maps = hash:\/etc\/postfix\/sasl\\_passwd\r\nsmtp\\_sasl\\_security\\_options =\r\nsender\\_canonical\\_maps = hash:\/etc\/postfix\/sender\\_canonical\r\nmynetworks = 127.0.0.0\/8 [::ffff:127.0.0.0]\/104 [::1]\/128\r\nmailbox\\_command = \/usr\/bin\/procmail -a \"$EXTENSION\"\r\nmailbox\\_size\\_limit = 0\r\nrecipient\\_delimiter = +\r\ninet\\_interfaces = loopback-only<\/pre>\n<p>I added the following to <tt>\/etc\/postfix\/sasl\\_passwd<\/tt>:<\/p>\n<pre>smtp.comcast.net MyUsername:MyPassword<\/pre>\n<p>I added the following to \/etc\/postfix\/sender\\_canonical:<\/p>\n<pre>jaredrob MyUsername@comcast.net<\/pre>\n<p>I ran the following commands:<\/p>\n<pre>  chmod o-r \/etc\/postfix\/sasl_passwd\r\n  postfix check\r\n  postmap \/etc\/postfix\/sasl\\_passwd\r\n  postmap \/etc\/postfix\/sender\\_canonical\r\n  postalias \/etc\/aliases<\/pre>\n<p>Next, I tested my email configuration by sending test email messages (using &#8216;mutt&#8217; or &#8216;mail&#8217;)&#8230;<\/p>\n<ol>\n<li>From my local linux account to my local linux account, to make sure local delivery worked and didn&#8217;t get sent to my ISP.<\/li>\n<li>From the local &#8216;root&#8217; account to my local linux account.<\/li>\n<li>From the local &#8216;root&#8217; account to my local &#8216;root&#8217; account, to make sure it was forwarded to my local user account (remember \/etc\/aliases?)<\/li>\n<li>From my local account to an external account (gmail, etc.)\n<ol>\n<li>I didn&#8217;t expect it to be delivered at this point. Remember the &#8220;.NOT&#8221; I added to my relay host? This way, I was able to see where outbound email was destined using &#8220;mailq&#8221;. This saved me grief because I found misconfigurations that would have lost the email.\u00a0\u00a0I used &#8216;postsuper -d ALL&#8217; to delete all test messages from the queue.<\/li>\n<li>When I knew delivery was destined for the correct machines, I removed the &#8220;.NOT&#8221; from main.cf, and ran &#8220;service postfix reload&#8221; (as root).<\/li>\n<li>Next, I sent email to an external email address, and made sure it was delivered<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>Then I configured and ran &#8216;fetchmail&#8217; briefly (hitting CTRL-C after a few were downloaded), and made sure messages were delivered to my local account properly. I&#8217;ve been pleased using Ubuntu with postfix, fetchmail and procmail and <a href=\"http:\/\/archivemail.sourceforge.net\/\">archivemail<\/a>. I often log in remotely using SSH and use <a href=\"http:\/\/www.mutt.org\/\">mutt<\/a> to read my email. I also use Google Mail. I&#8217;ve set up rules to forward some email to my ISP account, which get downloaded using fetchmal via cron job.<\/p>\n<p>Why do I bother saving my email to my local machine? I like redundancy and backups, I like the speed of using a command line email reader, and I have ten years of email archived on my local machine. It&#8217;s been very useful to be able to search through that email for old software license keys, website passwords, email addresses and such.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After having had Ubuntu 12.04 installed for months, I finally moved my old Fedora services over to it, including Postfix. Here&#8217;s how I configured it. I configured \/etc\/aliases so that local email destined for &#8216;root&#8217; (including regularly scheduled system cron jobs) is delivered to my local account, instead of being sent to root@comcast.net (they don&#8217;t &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/jaredrobinson.com\/blog\/postfix-on-ubuntu-12-04\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Postfix on Ubuntu 12.04 with Comcast&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,17],"tags":[],"class_list":["post-798","post","type-post","status-publish","format-standard","hentry","category-linux","category-tech"],"_links":{"self":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/798","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/comments?post=798"}],"version-history":[{"count":13,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/798\/revisions"}],"predecessor-version":[{"id":1475,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/798\/revisions\/1475"}],"wp:attachment":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/media?parent=798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/categories?post=798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/tags?post=798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}