{"id":1079,"date":"2019-12-16T14:19:17","date_gmt":"2019-12-16T03:19:17","guid":{"rendered":"https:\/\/jandmf.com\/?p=1079"},"modified":"2019-12-19T13:31:00","modified_gmt":"2019-12-19T02:31:00","slug":"getting-e-mail-happening","status":"publish","type":"post","link":"https:\/\/jandmf.com\/index.php\/2019\/12\/16\/getting-e-mail-happening\/","title":{"rendered":"Getting e-mail happening"},"content":{"rendered":"<p>So I had this brainwave and thought it&#8217;d be a good idea to set up a Pi as an e-mail server. After all, how hard could it be, there are hundreds of thousands of mail servers around the globe that work well. What could possibly go wrong ?<\/p>\n\n\n<p>I started out trying to keep it simple. I&#8217;m pretty familiar with Sendmail but I figured that I&#8217;d go with something simple as I was only going to serve two users and Sendmail seemed a lot of overkill.<\/p>\n\n\n\n<p>After a bit of searching Citadel seemed to fit well. I installed it and configured but there is no way I could get past a couple of errors not the least if which is &#8220;db:cursor still in progress on cdb 02: attempt to write during a r\/o cursor&#8221;.  I tried a completely fresh install of Raspbian Buster with a brand new install of Citadel. Still no dice. Searched for more comprehensive doco but, again, to no avail. I reckon I just about wore out the search engines looking for a solution but still no illumination. I even tried downloading the source and buildin it from scratch. The same olf &#8220;db:cursor still in progress&#8230;&#8221; error persisted. <\/p>\n\n\n\n<p>Scratch Citadel which is a pity really as I reckon it&#8217;d be the bees knees for a simple and small e-mail server.<\/p>\n\n\n\n<p>On to Dovecot and Postfix. I had a few issues but by carefully following the <a href=\"https:\/\/www.postfix.org\/documentation.html\" target=\"_blank\" rel=\"noopener\"> documentation<\/a> on Postfix.org I had it all up and running. In the beginning I had a lot of trouble getting &#8220;saslauthd&#8221; to do the authentication and I spent a goodish amount of time trying to treat the symptoms without success. At this point I decided to get rid of postfix and dovecot and start again from a new install of both. The big difference this time was that I folloed the docs on postfix.org to the letter. Surprise, surprise it all worked as it should. <\/p>\n\n\n\n<p>After years and years of telling people to RTFM I didn&#8217;t.Once I did RTFM I proved my own point yet again.<\/p>\n\n\n\n<p>Now came the hard part. DNS records. I use a dynamic DNS which has served me very well thus far. Setting up the MX record was very easy but I discovered I needed a PTR (for reverse lookups) and this is where the gremlins started to creep in. I needed a static address. No problem just ask my ISP, right ? Easily doable, for another ten bucks a month. Sign the static IP over to the dynamic DNS provider so that they can use it for all DNS records. ISP says &#8211; &#8220;oh no we can&#8217;t do that&#8221;. Luckily my dynamic DNS provider has a facility that can easily get around that particular scenario.<\/p>\n\n\n\n<p>Now that it all works, I&#8217;m happy and am quite willing to advocate for the Postfix \/ Dovecot sulution. It&#8217;s a lot easier to configure than Sendmail. The configuration files are well commented and make sense, unlike Sendmail.<\/p>\n\n\n\n<p>If you&#8217;re considering setting up your own mail server first check that you can get a PTR DNS record. If you can&#8217;t look for another solution. If you can, RTFM and pay attention to the details and recommendations.<\/p>\n\n\n\n<p>Just for fun and games on our internal network I set up a DNS complete with MX and PTR records and with the internal e-mail system configured to insist on reverse lookups it worked perfectly with no errors. Of course this was only with two Pi&#8217;s, two PC&#8217;s and two windows tablets. I&#8217;ve got rid of it all now I know how to make it work and that there&#8217;s no point with an uncooperative ISP.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>So I had this brainwave and thought it&#8217;d be a good idea to set up a Pi as an e-mail server. After all, how hard could it be, there are hundreds of thousands of mail servers around the globe that work well. What could possibly go wrong ? I started out trying to keep it &hellip; <a href=\"https:\/\/jandmf.com\/index.php\/2019\/12\/16\/getting-e-mail-happening\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Getting e-mail happening&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53],"tags":[],"class_list":["post-1079","post","type-post","status-publish","format-standard","hentry","category-pi"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/posts\/1079","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/comments?post=1079"}],"version-history":[{"count":4,"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/posts\/1079\/revisions"}],"predecessor-version":[{"id":1219,"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/posts\/1079\/revisions\/1219"}],"wp:attachment":[{"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/media?parent=1079"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/categories?post=1079"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/tags?post=1079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}