{"id":501,"date":"2010-05-25T12:35:18","date_gmt":"2010-05-25T17:35:18","guid":{"rendered":"http:\/\/it.thelibrarie.com\/weblog\/?p=501"},"modified":"2010-05-25T12:35:18","modified_gmt":"2010-05-25T17:35:18","slug":"postfix-dovecot-smtp-relay","status":"publish","type":"post","link":"https:\/\/it.thelibrarie.com\/weblog\/2010\/05\/postfix-dovecot-smtp-relay\/","title":{"rendered":"Postfix, Dovecot, SMTP Relay"},"content":{"rendered":"<p>After setting up a BIND DNS on my Ubuntu 10.04 x32 server, I decided I should probably make a mail server too.  I wanted to be able to access the mail from my iPhone.<\/p>\n<p>Postfix was installed by default as I needed sendmail for some other php scripts I had previously written\/edited.  Otherwise you can always <code>apt-get install postfix<\/code><\/p>\n<p>I let webmin install dovecot for me.  Dovecot is a POP3\/IMAP server that will communicate with postfix&#8217;s mail system.  Basically it&#8217;ll read the mail from \/var\/mail (which I had to edit &#8211; more on that later).  I then set the DNS name for mail.mydomain.tld using BIND on webmin.<\/p>\n<p>Use webmin and open up Servers > Dovecot<br \/>\nClick Networking and Protocols<br \/>\n<code>I selected POP3<\/code><br \/>\nClick Save<br \/>\nClick on User and Login Options<br \/>\n<code>SASL authentication realms: mail.yourdomain.tld<\/code><br \/>\n<code>Authentication methods: plain text<\/code><br \/>\nClick save<br \/>\nClick on Mail Files<br \/>\n<code>Select Inbox under \/var\/mail, folders in ~\/mail<\/code><br \/>\nClick apply configuration<\/p>\n<p>Then I made sure that port 110 was opened up on the firewall and away I went.  I could now connect to the server via POP3 on the iPhone and retrieve my mail.  However, I could not send mail.  The fix for that (Found from <a href=\"http:\/\/www.jimmy.co.at\/weblog\/?p=52\">Jimmy&#8217;s Weblog<\/a>):<br \/>\n<code>apt-get install postfix-tls sasl2-bin libsasl2 libsasl2-modules<\/code><br \/>\n<code>nano \/etc\/default\/saslauthd<\/code><\/p>\n<blockquote><p>START=yes<br \/>\nMECHANISMS=&#8221;pam&#8221;<\/p><\/blockquote>\n<p><code>nano \/etc\/postfix\/sasl\/smtpd.conf<\/code><\/p>\n<blockquote><p>pwcheck_method: saslauthd<\/p><\/blockquote>\n<p><code>nano \/etc\/postfix\/main.cf<\/code><\/p>\n<blockquote><p>smtpd_sasl_auth_enable = yes<br \/>\nsmtpd_sasl_security_options = noanonymous<br \/>\nbroken_sasl_auth_clients = yes<br \/>\nsmtpd_recipient_restrictions =<br \/>\n        permit_sasl_authenticated,<br \/>\n        permit_mynetworks,<br \/>\n        reject_unauth_destination<\/p><\/blockquote>\n<p><code>rm -r \/var\/run\/saslauthd\/<\/code><br \/>\n<code>mkdir -p \/var\/spool\/postfix\/var\/run\/saslauthd<\/code><br \/>\n<code>ln -s \/var\/spool\/postfix\/var\/run\/saslauthd \/var\/run<\/code><br \/>\n<code>chgrp sasl \/var\/spool\/postfix\/var\/run\/saslauthd<\/code><br \/>\n<code>adduser postfix sasl<\/code><\/p>\n<p>\/etc\/init.d\/postfix restart<br \/>\n\/etc\/init.d\/saslauthd start<\/p>\n<p>Honestly by that time I had changed a few other things in the postfix configuration, so hopefully this still works.  If I ever set it up again or do a dry run on a secondary test system (ie if I find the time to QA my own work) then I will most definitely put up any updates.  Any issues let me know.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After setting up a BIND DNS on my Ubuntu 10.04 x32 server, I decided I should probably make a mail server too. I wanted to be able to access the mail from my iPhone. Postfix was installed by default as I needed sendmail for some other php scripts I had previously written\/edited. Otherwise you can &hellip; <a href=\"https:\/\/it.thelibrarie.com\/weblog\/2010\/05\/postfix-dovecot-smtp-relay\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Postfix, Dovecot, SMTP Relay<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-501","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/501","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/comments?post=501"}],"version-history":[{"count":2,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/501\/revisions"}],"predecessor-version":[{"id":503,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/501\/revisions\/503"}],"wp:attachment":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/media?parent=501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/categories?post=501"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/tags?post=501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}