{"id":2721,"date":"2018-06-24T09:36:53","date_gmt":"2018-06-24T16:36:53","guid":{"rendered":"http:\/\/www.wellgolly.com\/?p=2721"},"modified":"2018-07-06T12:23:46","modified_gmt":"2018-07-06T19:23:46","slug":"getting-dovecot-running-on-a-new-server","status":"publish","type":"post","link":"https:\/\/www.wellgolly.com\/?p=2721","title":{"rendered":"Getting Dovecot running on a new server."},"content":{"rendered":"<p>I followed <a href=\"https:\/\/help.ubuntu.com\/community\/Dovecot\">these<\/a> Dovecot installation instructions and everything appeared to work, but I couldn\u2019t get mail. I went into my mail client and retyped the password. I got an error message when it tried to verify the server saying that I had an invalid certificate.<\/p>\n<p>I tried getting a standalone certificate using certbot, but my attempt failed. It turns out that you need to stop apache before running certbot with the standalone command. Then run:<br \/>\n<pre><code class=\"preserve-code-formatting\">\nsudo certbot certonly --standalone --preferred-challenges http -d mail.mymaildomain.com &lt;code&gt;\n<\/code><\/pre><br \/>\nThis puts a new certificate just for mail in the <em>\/etc\/letsencrypt\/live\/mail.mymaildomain.com <\/em>directory. You need to tell Dovecot where to find the certificate by editing the SSL file.<\/p>\n<p>Look for these lines near the top of the file.<br \/>\n<pre><code class=\"preserve-code-formatting\">\n#ssl_cert = &lt;\/etc\/dovecot\/dovecot.pem\n#ssl_key = &lt;\/etc\/dovecot\/private\/dovecot.pem\n<\/code><\/pre><br \/>\n<a href=\"https:\/\/aoeex.com\/phile\/postfix-dovecot-and-lets-encrypt-certificates\/\">Configure Dovecot<\/a><\/p>\n<div class='indent'>\nDovecot&#8217;s SSL configuration is done in an auxiliary file located at \/etc\/dovecot\/conf.d\/10-ssl.conf. In here you&#8217;ll find two parameters that need to be changed: ssl_cert and ssl_key. Like postfix, dovecot will need the full certificate chain to present to clients for validation.<\/p>\n<p>Edit the configuration file to point to the new certificates. Be sure to include the leading < before the file path, this is what tells dovecot to read from a file rather than use the value literally.\n<pre><code class=\"preserve-code-formatting\">\nssl_cert = &lt;\/etc\/letsencrypt\/live\/mail.example.com\/fullchain.pem\nssl_key = &lt;\/etc\/letsencrypt\/live\/mail.example.com\/privkey.pem\n<\/code><\/pre>\n<\/div>\n<p>The only other issue I had was with the mail_location. I must have picked mbox format when the messages are in Maildir format. I changed this line in <em>10-mail.conf<\/em>.<br \/>\n<pre><code class=\"preserve-code-formatting\">\nmail_location = maildir:~\/Maildir\n<\/code><\/pre><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I followed these Dovecot installation instructions and everything appeared to work, but I couldn\u2019t get mail. I went into my mail client and retyped the password. I got an error message when it tried to verify the server saying that I had an invalid certificate. I tried getting a standalone certificate using certbot, but my &hellip; <a href=\"https:\/\/www.wellgolly.com\/?p=2721\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Getting Dovecot running on a new server.<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-2721","post","type-post","status-publish","format-standard","hentry","category-computers"],"_links":{"self":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/2721","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2721"}],"version-history":[{"count":0,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/2721\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}