{"id":701,"date":"2017-03-21T13:00:01","date_gmt":"2017-03-21T11:00:01","guid":{"rendered":"https:\/\/helia.ee\/koolitus\/?page_id=701"},"modified":"2017-03-21T13:00:01","modified_gmt":"2017-03-21T11:00:01","slug":"debian-8-how-to-set-up-a-postfix-e-mail-server-with-dovecot","status":"publish","type":"page","link":"https:\/\/helia.ee\/koolitus\/?page_id=701","title":{"rendered":"Debian 8 &#8211; How To Set Up a Postfix E-Mail Server with Dovecot"},"content":{"rendered":"<div class=\"section-content section-content-growable content Tutorial-content\">\n<div class=\"content-body tutorial-content tutorial-content-legacy\" data-growable-markdown=\"\">\n<h3 id=\"postfix-introduction\">Postfix Introduction<\/h3>\n<p>This tutorial will tell you how to setup a basic mail server and teach you a bit about the Postfix MTA (Mail Transfer Agent) in the process.<\/p>\n<p>Postfix is extremely flexible. Its architecture is based on a loose composition of services that receive emails and pass them on to other services (with services like &#8220;smtp&#8221; on the receiving outer edge, and &#8220;local&#8221; and &#8220;virtual&#8221; on the delivering outer edge, if you&#8217;re looking at receiving mail). Postfix itself implements the core requirements to receive, route, and deliver mail, and relies on third-party extensions to do the rest.<\/p>\n<p>Postfix has several hundred <a href=\"http:\/\/www.postfix.org\/BASIC_CONFIGURATION_README.html\">configuration parameters<\/a>. If you want to administer a mail server that reliably delivers business requirements to a sizable organization, you should make yourself intimate with all of them (<a href=\"http:\/\/www.postfix.org\/postconf.5.html\">man 5 postconf<\/a>). This tutorial will <em>not<\/em> be enough, on its own, to make you a competent professional email admin. However, if you want to become familiar with postfix or set up a mail server for yourself and a few friends, this tutorial, and the ones to follow, will be your friend.<\/p>\n<h3 id=\"dovecot-introduction\">Dovecot Introduction<\/h3>\n<p>I&#8217;m not going to spend a lot of introductory words on dovecot. Dovecot is also huge (here is the <a href=\"http:\/\/wiki2.dovecot.org\/\">wiki for dovecot 2<\/a>), but we only want a very small set of features from dovecot.<\/p>\n<p>This article explains almost every single setting to be set in detail. You can go ahead and skim over the explanations if you want &#8211; <em>at your own risk<\/em>.<\/p>\n<p><strong>This tutorial assumes (and was built using) the following setup:<\/strong><\/p>\n<ul>\n<li>Debian 7.1 <em>wheezy<\/em> x64_86<\/li>\n<li>Postfix 2.9.6-2<\/li>\n<li>dovecot 1:2.1.7-7<\/li>\n<\/ul>\n<p>While any Debian-based OS should be fine, Postfix is in use in a wide array of versions, including Postfix 1.x, Postfix 2.9, and Postfix 2.10, which have some mutually incompatible settings and features &#8211; and using Postfix 2.9, this tutorial is not on the bleeding edge.<\/p>\n<p>This tutorial also assumes a few things about you:<\/p>\n<ul>\n<li>That you are comfortable on a GNU\/Linux commandline and with the general layout and working principles of a GNU\/Linux system like Debian.<\/li>\n<li>That your local system is a GNU\/Linux or reasonably compatible (MinGW, Cygwin, Mac OS X, *BSD)<\/li>\n<li>That you know how to get a rootshell on your droplet<\/li>\n<li>That you know how to use a text editor (e.g. vim, nano, emacs, or the standard editor, <code>ed<\/code>) on linux\n<p>By default, commands will be entered and files edited from a rootshell on the droplet. As in most other DigitalOcean articles, parts of commands that you need to customize will be <span class=\"highlight\">highlighted<\/span> in red.<\/li>\n<\/ul>\n<div data-unique=\"system-setup\"><\/div>\n<h2 id=\"system-setup\">System Setup<\/h2>\n<p>The following ingredients are necessary to make your droplet ready to be a mail server:<\/p>\n<ul>\n<li>A domain, let&#8217;s assume it is &#8220;mydomain.com&#8221;<\/li>\n<li>A hostname for your mail server, let&#8217;s assume &#8220;mail.mydomain.com&#8221;<\/li>\n<li>An SSL certificate that is valid for &#8220;mail.mydomain.com&#8221;<\/li>\n<\/ul>\n<h3 id=\"setting-up-ssl-certificate\">Setting up SSL certificate<\/h3>\n<p>For SSL, you need a certificate and a private key. In this tutorial, we&#8217;re going to assume that the certificate is saved in <code>\/etc\/ssl\/certs\/mailcert.pem<\/code> and the key is saved in <code>\/etc\/ssl\/private\/mail.key<\/code>. Make sure the key is only readable by the root user!<\/p>\n<p>How to set up SSL certificates for your website and e-mail depends on your website structure and the CA you use (self-signed, organisational (sub)-ca, or commercial ca for example). Creating a self-signed test certificate is as easy as executing<\/p>\n<pre class=\"code-pre \"><code>sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout \/etc\/ssl\/private\/mail.key -out \/etc\/ssl\/certs\/mailcert.pem\r\n<\/code><\/pre>\n<p>and leaving the default values in by just hitting enter on all questions asked. Don&#8217;t use this certificate in production!<\/p>\n<p>Most CAs will require you to submit a certificate signing request. (CSR) You can generate one like this:<\/p>\n<pre class=\"code-pre \"><code>sudo openssl req -nodes -days 365 -newkey rsa:2048 -keyout \/etc\/ssl\/private\/mail.key -out mailcert.csr\r\n<\/code><\/pre>\n<p>Fill in the information queried properly, like in this transcript: (Check with the CA you intend to use on what information needs to be in the CSR)<\/p>\n<pre><code>Generating a 2048 bit RSA private key\r\n.............................+++\r\n................+++\r\nwriting new private key to 'mail.key'\r\n-----\r\nYou are about to be asked to enter information that will be incorporated\r\ninto your certificate request.\r\nWhat you are about to enter is what is called a Distinguished Name or a DN.\r\nThere are quite a few fields but you can leave some blank\r\nFor some fields there will be a default value,\r\nIf you enter '.', the field will be left blank.\r\n-----\r\nCountry Name (2 letter code) [AU]: <span class=\"highlight\">US<\/span>\r\nState or Province Name (full name) [Some-State]: <span class=\"highlight\">Virginia<\/span>\r\nLocality Name (eg, city) []: <span class=\"highlight\">Langley<\/span>\r\nOrganization Name (eg, company) [Internet Widgits Pty Ltd]: <span class=\"highlight\">Network Services Association<\/span>\r\nOrganizational Unit Name (eg, section) []: <span class=\"highlight\">Infrastructure Services<\/span>\r\nCommon Name (e.g. server FQDN or YOUR name) []: <span class=\"highlight\">mail.mydomain.com<\/span>\r\nEmail Address []: <span class=\"highlight\">postmaster@mydomain.com<\/span>\r\n\r\nPlease enter the following 'extra' attributes\r\nto be sent with your certificate request\r\nA challenge password []:\r\nAn optional company name []:\r\n<\/code><\/pre>\n<p>(Note that this way you cannot create a certificate valid for more than one domain using the <code>subjectAltName<\/code> field without some additional work &#8211; again, check the CA&#8217;s documentation!)<\/p>\n<h3 id=\"setting-up-dns\">Setting up DNS<\/h3>\n<p>You have to set up your DNS with an A record that points to your mail server IP and an MX record that points to the mail servers hostname.<\/p>\n<p>Here is how to do it if you&#8217;re using DigitalOcean&#8217;s DNS:<\/p>\n<ul>\n<li>Go to the &#8220;DNS&#8221; area in your DigitalOcean panel<\/li>\n<li>Create a new domain or select one you&#8217;ve created before<\/li>\n<li>Click the &#8220;Add record&#8221; button in the top right<\/li>\n<li>Add an A record:<\/li>\n<\/ul>\n<p class=\"growable\"><img decoding=\"async\" src=\"https:\/\/assets.digitalocean.com\/articles\/postfix_dovecot\/img1.png\" alt=\"Adding an A record\" \/><\/p>\n<ul>\n<li>Click &#8220;Add record&#8221; again and add an MX record that points to the A record:<\/li>\n<\/ul>\n<p class=\"growable\"><img decoding=\"async\" src=\"https:\/\/assets.digitalocean.com\/articles\/postfix_dovecot\/img2.png\" alt=\"Adding an MX record\" \/><\/p>\n<p>Additional information can be found in the <a href=\"https:\/\/www.digitalocean.com\/community\/articles\/how-to-set-up-a-host-name-with-digitalocean\">Host Name setup<\/a> and <a href=\"https:\/\/www.digitalocean.com\/community\/articles\/dns-tips-and-tricks\">DNS tips and tricks<\/a> articles.<\/p>\n<h3 id=\"verify-dns\">Verify DNS<\/h3>\n<p>DNS will take a few hours to propagate all over the internet, but it should be set on your DNS server after a few minutes. You can check with <strong>dig<\/strong> &amp; <strong>host<\/strong>:<\/p>\n<pre><code>[root@yourbase] ~# dig MX <span class=\"highlight\">mydomain.com<\/span> +short <a class=\"username-tag\" href=\"https:\/\/www.digitalocean.com\/community\/users\/ns1\">@ns1<\/a>.digitalocean.com\r\n50 mail.mydomain.com.\r\n[root@yourbase] ~# host <span class=\"highlight\">mail.mydomain.com<\/span> ns1.digitalocean.com\r\nUsing domain server:\r\nName: ns1.digitalocean.com\r\nAddress: 198.199.120.125#53\r\nAliases:\r\n\r\nmail.mydomain.com has address 82.196.9.119\r\n<\/code><\/pre>\n<div data-unique=\"postfix\"><\/div>\n<h2 id=\"postfix\">Postfix<\/h2>\n<p>We will now set up Postfix to receive and deliver mail for local users.<\/p>\n<h3 id=\"packages\">Packages<\/h3>\n<p>The default MTA on Debian is exim. Off with it! We&#8217;ll also stop postfix after it has been installed, because we don&#8217;t want it to be running yet.<\/p>\n<pre class=\"code-pre \"><code>aptitude remove exim4 &amp;&amp; aptitude install postfix &amp;&amp; postfix stop\r\n<\/code><\/pre>\n<p>A small insert: Postfix manages its daemons by itself and doesn&#8217;t need the service (init.d) system. postfix start, postfix stop, and postfix reload are equivalent to service postfix start, service postfix stop and service postfix reload.<\/p>\n<h3 id=\"postfix-configuration\">Postfix Configuration<\/h3>\n<p>Postfix has two main config files: <strong>main.cf<\/strong>, which specifies what you would think of as config options, and <strong>master.cf<\/strong>, which specifies the services postfix should run.<\/p>\n<p>First, configure the <strong>master.cf<\/strong> file (in <code>\/etc\/postfix\/<\/code>). Add an extra &#8220;smtpd&#8221; instance called &#8220;submission&#8221; that will take mail from trusted clients for delivery to the world at large, which we don&#8217;t allow for anyone else.<br \/>\nTo do that, open master.cf (take a look at <a href=\"http:\/\/www.postfix.org\/master.5.html\">man 5 master<\/a> if you want to understand what&#8217;s going on) and uncomment the submission config and add options to enable SASL:<\/p>\n<pre class=\"code-pre \"><code>submission inet n       -       -       -       -       smtpd\r\n  -o syslog_name=postfix\/submission\r\n  -o smtpd_tls_wrappermode=no\r\n  -o smtpd_tls_security_level=encrypt\r\n  -o smtpd_sasl_auth_enable=yes\r\n  -o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject\r\n  -o milter_macro_daemon_name=ORIGINATING\r\n  -o smtpd_sasl_type=dovecot\r\n  -o smtpd_sasl_path=private\/auth\r\n<\/code><\/pre>\n<p>This warrants a bit of explanation. The <code>-o ...<\/code> options override the settings that are taken from defaults or define in the config, which we&#8217;ll set later.<br \/>\nIn a nutshell what happens here is that this enables the &#8220;submission&#8221; daemon with TLS to secure the outer connection, and dovecot-mediated SASL to check the username and password of connecting clients. (We will set that up in dovecot later).<\/p>\n<p>The important detail is one that can&#8217;t be seen: The <code>smtpd_recipient_restrictions<\/code> is missing <a href=\"http:\/\/www.postfix.org\/postconf.5.html#reject_unauth_destination\"><code>reject_unauth_destination<\/code><\/a>, which is present as a default and restricts relaying.<\/p>\n<p>Then we move on to <strong>main.cf<\/strong>. We&#8217;ll start with a clean slate here &#8211; run <code>cp \/etc\/postfix\/main.cf \/etc\/postfix\/main.cf.orig<\/code> if you want to save the default config file (it&#8217;s also in <code>\/usr\/share\/postfix\/main.cf.dist<\/code> though), then open it and clear it out!<\/p>\n<p>Let&#8217;s first set the network information: (information about the domains postfix is handling mail for, and a bit of extra info)<\/p>\n<pre><code>myhostname = <span class=\"highlight\">mail.domain.com<\/span>\r\nmyorigin = <span class=\"highlight\">\/etc\/mailname<\/span>\r\nmydestination = <span class=\"highlight\">mail.domain.com, domain.com<\/span>, localhost, localhost.localdomain\r\nrelayhost =\r\nmynetworks = 127.0.0.0\/8 [::ffff:127.0.0.0]\/104 [::1]\/128\r\nmailbox_size_limit = 0\r\nrecipient_delimiter = +\r\ninet_interfaces = all\r\n<\/code><\/pre>\n<p>We set the hostname and the default origin, which is sourced from <strong>\/etc\/mailname<\/strong> by debian convention. You can set it explicitly if you don&#8217;t have <strong>\/etc\/mailname<\/strong>. The default origin is used to construct the &#8216;From&#8217; address for local users. <strong>mydestination<\/strong> sets the domains that postfix accepts emails for as final destination, and we set &#8220;relayhost&#8221; empty to disable relaying mail (relaying means accepting mail and then forwarding to a mail server that is not the final destination for the mail and we have no need for that; that is useful e.g. in a corporate intranet where a central mail server should check mail before it leaves the network.)<\/p>\n<p><em>Additional note: This has nothing to do with the term &#8220;open relay&#8221;, which is a mail server that accepts email from anybody without authentication and sends it to MTAs for domains that aren&#8217;t in their own network &#8211; for this the other `relay_<\/em>` settings are used, which we leave on default and disabled)<\/p>\n<p>Let&#8217;s now set the local alias maps. We don&#8217;t have to set this setting since we&#8217;re just keeping the default setting, but it&#8217;s good to make it explicit in case we later want to add another method of defining alias maps. (like a real DBMS)<\/p>\n<pre class=\"code-pre \"><code>alias_maps = hash:\/etc\/aliases\r\nalias_database = hash:\/etc\/aliases\r\n<\/code><\/pre>\n<p>Then we set up SSL:<\/p>\n<pre><code>smtpd_tls_cert_file=<span class=\"highlight\">\/etc\/ssl\/certs\/mailcert.pem<\/span>\r\nsmtpd_tls_key_file=<span class=\"highlight\">\/etc\/ssl\/private\/mail.key<\/span>\r\nsmtpd_use_tls=yes\r\nsmtpd_tls_session_cache_database = btree:${data_directory}\/smtpd_scache\r\nsmtp_tls_session_cache_database = btree:${data_directory}\/smtp_scache\r\nsmtpd_tls_security_level=may\r\nsmtpd_tls_protocols = !SSLv2, !SSLv3\r\n<\/code><\/pre>\n<p>We set the cert file and the key for it, enable tls, and set the cache files. Then we make TLS optional, because we&#8217;re not allowed to make TLS required on a public smtp server per <a href=\"http:\/\/tools.ietf.org\/html\/rfc2487\">RFC2487<\/a>. We also disallow SSLv2 and SSLv3, so that only TLSv1.0 and higher is allowed (read a SSL tutorial if you want to know why &#8211; in a nutshell, SSLv2 and SSLv3 are obsolete).<\/p>\n<p>Another setting that is fine as default but should be specified explicitly in case you want to add to it later is the <strong>local<em>recipient<\/em>maps<\/strong>:<\/p>\n<pre class=\"code-pre \"><code>local_recipient_maps = proxy:unix:passwd.byname $alias_maps\r\n<\/code><\/pre>\n<p>This setting tells Postfix to check a lookup table and reject email to users that cannot be found in the table. This is important because the alternative behaviour, if <code>local_recipient_maps<\/code> is unset, is to accept mail first and then bounce it later. This causes &#8220;backscatter&#8221;: If postfix cannot determine all valid users immediately (in the smtpd service), like when <code>local_recipients_maps<\/code> is unset, it will accept mail and then send a non-delivery notice later (when it finds out the mail is undeliverable after it has been handed off by smptd). These non-delivery notices usually hit innocent people whose addresses have been spoofed in spam and scam mails and contribute to the spam problem.<\/p>\n<h3 id=\"sane-alias-config\">Sane Alias Config<\/h3>\n<p>There are a few mail accounts you should set up in your alias config that are important. For example the <a href=\"http:\/\/www.ietf.org\/rfc\/rfc5321.txt\">SMTP RFC<\/a> mandates that any publicly accessible mailserver that accepts any mail at all must also accept mail to the &#8216;postmaster&#8217; account, and some people might expect &#8220;hostmaster&#8221;, &#8220;abuse&#8221;, &#8220;webmaster&#8221;, and other mailboxes to be present. You can either redirect those mail addresses to root, or to a specific user. Here is a sane default for <code>\/etc\/aliases<\/code>, presuming that you check email for <strong>root<\/strong>:<\/p>\n<pre class=\"code-pre \"><code>mailer-daemon: postmaster\r\npostmaster: root\r\nnobody: root\r\nhostmaster: root\r\nusenet: root\r\nnews: root\r\nwebmaster: root\r\nwww: root\r\nftp: root\r\nabuse: root\r\n<\/code><\/pre>\n<p>If you want to redirect all of that to a specific local user, say, &#8220;yourname&#8221; just add<\/p>\n<pre><code>root: <span class=\"highlight\">yourname<\/span>\r\n<\/code><\/pre>\n<p>Postfix will resolve the entire chain of aliases for you and forward all those mail addresses to &#8220;yourname&#8221;. (This is done by the <a href=\"http:\/\/www.postfix.org\/local.8.html\">local<\/a> daemon using the <a href=\"http:\/\/www.postfix.org\/aliases.5.html\">aliases<\/a> specification.)<\/p>\n<p>As &#8220;aliases&#8221; says, after updating the <strong>\/etc\/aliases<\/strong> file, you have to run<\/p>\n<pre class=\"code-pre \"><code>newaliases\r\n<\/code><\/pre>\n<p>to compile the file into the database Postfix uses for fast lookup.<\/p>\n<div data-unique=\"dovecot\"><\/div>\n<h2 id=\"dovecot\">Dovecot<\/h2>\n<p>This one will be less wall-of-text-y! Take a deep breath, we&#8217;re almost done.<\/p>\n<h3 id=\"packages\">Packages<\/h3>\n<pre class=\"code-pre \"><code>aptitude install dovecot-core dovecot-imapd\r\n<\/code><\/pre>\n<p>Should do it. If you want all the default packages, run<\/p>\n<pre class=\"code-pre \"><code>aptitude install dovecot-common\r\n<\/code><\/pre>\n<p>Then go into <code>\/etc\/dovecot\/dovecot.conf<\/code> and clear out the file again. (that&#8217;s important this time &#8211; the default config includes a bunch of subordinate config files in <code>\/etc\/dovecot\/conf.d<\/code> that we don&#8217;t want).<\/p>\n<p>Now enter the following config:<\/p>\n<pre class=\"code-pre \"><code>disable_plaintext_auth = no\r\nmail_privileged_group = mail\r\nmail_location = mbox:~\/mail:INBOX=\/var\/mail\/%u\r\nuserdb {\r\n  driver = passwd\r\n}\r\npassdb {\r\n  args = %s\r\n  driver = pam\r\n}\r\nprotocols = \" imap\"\r\n<\/code><\/pre>\n<p>This enables plaintext auth (The &#8220;plaintext&#8221; authentication will be tunneled through TLS), tells dovecot to use the <code>mail<\/code> system group for accessing the local mailboxes (plus the location of the mailboxes), use the unix authentication system to authenticate users, and enable imap only.<\/p>\n<p>If you want, you can have dovecot automatically add a Trash and Sent folder to mailboxes:<\/p>\n<pre class=\"code-pre \"><code>protocol imap {\r\n  mail_plugins = \" autocreate\"\r\n}\r\nplugin {\r\n  autocreate = Trash\r\n  autocreate2 = Sent\r\n  autosubscribe = Trash\r\n  autosubscribe2 = Sent\r\n}\r\n<\/code><\/pre>\n<p>Next, we need to open a socket that postfix can use to piggy-back on dovecot&#8217;s authentication:<\/p>\n<pre class=\"code-pre \"><code>service auth {\r\n  unix_listener \/var\/spool\/postfix\/private\/auth {\r\n    group = postfix\r\n    mode = 0660\r\n    user = postfix\r\n  }\r\n}\r\n<\/code><\/pre>\n<p>And finally the ssl config:<\/p>\n<pre><code>ssl=required\r\nssl_cert = &lt;<span class=\"highlight\">\/etc\/ssl\/certs\/mailcert.pem<\/span>\r\nssl_key = &lt;<span class=\"highlight\">\/etc\/ssl\/private\/mail.key<\/span>\r\n<\/code><\/pre>\n<p>Note the angle brackets! They tell dovecot to read from a file.<\/p>\n<div data-unique=\"the-end\"><\/div>\n<h2 id=\"the-end\">The End<\/h2>\n<p>Save and close all the config files, and execute<\/p>\n<pre class=\"code-pre \"><code>newaliases\r\npostfix start\r\nservice dovecot restart\r\n<\/code><\/pre>\n<p>And you should be good to go. Test your config with a mail client, e.g. Mozilla Thunderbird. You should be able to send and receive mails from everywhere and to everywhere!<\/p>\n<h3 id=\"continued\">Continued<\/h3>\n<p>If you want to add virtual mailboxes (mail boxes that are not tied to a local user account, but can instead be configured using a local database) continue with <a href=\"https:\/\/www.digitalocean.com\/community\/articles\/how-to-set-up-a-postfix-email-server-with-dovecot-dynamic-maildirs-and-lmtp\">Part 2<\/a>.***<\/p>\n<p>You can now test that sending e-mail both ways works, from a terminal on the droplet:<\/p>\n<pre><code>~# mail <span class=\"highlight\">someotheremail@gmail.com<\/span>\r\nSubject: <span class=\"highlight\">test email from postfix\r\nthis is a test\r\n.<\/span>\r\nEOT\r\n<\/code><\/pre>\n<p>The mail from &#8220;<a href=\"mailto:root@yourdomain.com\">root@yourdomain.com<\/a>&#8221; should shortly arrive at &#8220;<a href=\"mailto:someotheremail@gmail.com\">someotheremail@gmail.com<\/a>&#8221; (fill in an email adress you control, obviously). If you reply to it and call <strong>mail<\/strong> again, you should see this: (it might take a minute for the mail to arrive).<\/p>\n<pre><code>~# mail\r\nHeirloom mailx version 12.5 6\/20\/10.  Type ? for help.\r\n\"\/var\/mail\/root\": 1 message\r\n&gt;N  1 <span class=\"highlight\">Your Name<\/span>          Wed Nov 13 23:45   41\/1966  Re: test email from postf\r\n<\/code><\/pre>\n<p>And if you hit the Enter key, it will show the message. (then type <strong>q<\/strong> and hit <strong>Enter<\/strong> to leave the mail client)<\/p>\n<p>The same thing will work with a local e-mail client. Set up a new system user:<\/p>\n<pre><code>~# adduser <span class=\"highlight\">joe<\/span>\r\nAdding user `joe' ...\r\nAdding new group `joe' (1001) ...\r\nAdding new user `joe' (1001) with group `joe' ...\r\nCreating home directory `\/home\/joe' ...\r\nCopying files from `\/etc\/skel' ...\r\nEnter new UNIX password: <span class=\"highlight\">Enter password here<\/span>\r\nRetype new UNIX password: <span class=\"highlight\">Enter password here<\/span>\r\npasswd: password updated successfully\r\nChanging the user information for joe\r\nEnter the new value, or press ENTER for the default\r\n        Full Name []:\r\n        Room Number []:\r\n        Work Phone []:\r\n        Home Phone []:\r\n        Other []:\r\nIs the information correct? [Y\/n] <span class=\"highlight\">Y<\/span>\r\n<\/code><\/pre>\n<p>The password you entered here is the password to use for e-mail. Joe can now use the address <code>joe@yourdomain.com<\/code> with a local mail client like Thunderbird. In Thunderbird, just add a new Account (<code>File -&gt; New -&gt; Existing Mail Account<\/code>) and enter <code>joe@yourdomain.com<\/code> and the password in the dialog.<\/p>\n<p>If your mail client doesn&#8217;t auto-detect the necessary settings: The username for the IMAP connection is <code>joe<\/code>, the port is 143, and the authentication method is unencrypted password via STARTTLS. For SMTP it&#8217;s the same, but port 587.<\/p>\n<p>If anything isn&#8217;t working, check for error messages in the system log with <code>tail -n 50 \/var\/log\/syslog<\/code>and in the mail log with <code>tail -n 50 \/var\/log\/mail.log<\/code>.<\/p>\n<div class=\"author\">Submitted by: <a href=\"https:\/\/twitter.com\/learlyman\">Lukas Erlacher<\/a><\/div>\n<\/div>\n<\/div>\n<div class=\"tutorial-footer\">\n<div class=\"tutorial-footer-details\">\n<div class=\"postable-info-bar-container\">\n<div class=\"postable-info-bar\">\n<div class=\"left-section\"><\/div>\n<div class=\"right-section\">\n<div class=\"upvote-container\"><button class=\"new-upvote-button\" name=\"button\" type=\"button\" data-upvotable-id=\"802\" data-upvotable-type=\"Tutorial\" data-include-caret=\"false\"><span class=\"new-upvote-text\">Upvote<\/span><span class=\"new-upvote-count\">43<\/span><\/button><\/div>\n<div class=\"section-item section-item-subscribe\"><span class=\"opt-in-switch off signed-out-subscribe\"><span class=\"subscribe-label\"> <span class=\"subscription-label subscribe\">Subscribe<\/span><\/span><\/span><\/div>\n<div class=\"section-item social-sharing-item\">\n<div class=\"sharing\"><a class=\"share-button\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-a-postfix-e-mail-server-with-dovecot#\" data-toggle=\"modal\" data-target=\"#share-modal\"> <span class=\"share-button-text\">Share<\/span><\/a><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"section-content tutorial-contributors zero\"><\/div>\n<\/div>\n<div class=\"tutorial-ctas\">\n<div class=\"section-content\">\n<div class=\"cta-description\">\n<h2>Pre-built applications on DigitalOcean<\/h2>\n<p>Get straight to deploying your code using one of our pre-configured images supporting Node.js, Rails, Redis, MongoDB, Cassandra, Docker, and many more.<\/p>\n<p><a class=\"cloud-tutorial-cta\" href=\"https:\/\/www.digitalocean.com\/products\/one-click-apps\/?utm_medium=btb_oneclickappsview-one-clicks\">VIEW ONE-CLICKS<\/a><\/div>\n<\/div>\n<\/div>\n<div class=\"related-tutorials\">\n<div class=\"section-content\">\n<h2>Related Tutorials<\/h2>\n<ul>\n<li><a class=\"related-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/why-you-may-not-want-to-run-your-own-mail-server\">Why You May Not Want To Run Your Own Mail Server<\/a><\/li>\n<li><a class=\"related-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-use-google-s-smtp-server\">How To Use Google&#8217;s SMTP Server<\/a><\/li>\n<li><a class=\"related-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-a-mail-relay-with-postfix-and-mailgun-on-ubuntu-16-04\">How to Set Up a Mail Relay with Postfix and Mailgun on Ubuntu 16.04<\/a><\/li>\n<li><a class=\"related-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-and-configure-postfix-on-ubuntu-16-04\">How To Install and Configure Postfix on Ubuntu 16.04<\/a><\/li>\n<li><a class=\"related-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-and-configure-postfix-as-a-send-only-smtp-server-on-ubuntu-16-04\">How to Install and Configure Postfix as a Send-Only SMTP Server on Ubuntu 16.04<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"content-comments\">\n<div class=\"section-content\">\n<div id=\"tutorial_802\" class=\"tutorial commentable\">\n<div class=\"comments-header\">\n<h4 class=\"comments-count\">150 Comments<\/h4>\n<\/div>\n<div class=\"response response-form no-avatar\">\n<form id=\"new_comment\" class=\"content-form disabled-form\" accept-charset=\"UTF-8\" action=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-a-postfix-e-mail-server-with-dovecot\/comments\" method=\"post\" data-remote=\"true\">\n<div class=\"meltdown_wrap\">\n<div class=\"meltdown_topmargin\"><\/div>\n<div class=\"meltdown_bar\">\n<ul class=\"meltdown_controls meltdown_controls_main\">\n<li class=\"meltdown_control-bold meltdown_control meltdown_controlbutton disabled\" title=\"\" data-original-title=\"Bold\">B<\/li>\n<li class=\"meltdown_control-italics meltdown_control meltdown_controlbutton disabled\" title=\"\" data-original-title=\"Italics\">I<\/li>\n<li class=\"meltdown_control-ul meltdown_control meltdown_controlbutton disabled\" title=\"\" data-original-title=\"Unordered List\">UL<\/li>\n<li class=\"meltdown_control-ol meltdown_control meltdown_controlbutton disabled\" title=\"\" data-original-title=\"Ordered List\">OL<\/li>\n<li class=\"meltdown_control-link meltdown_control meltdown_controlbutton disabled\" title=\"\" data-original-title=\"Link\">Link<\/li>\n<li class=\"meltdown_control-code meltdown_control meltdown_controlbutton disabled\" title=\"\" data-original-title=\"Code\">Code<\/li>\n<li class=\"meltdown_control-highlight meltdown_control meltdown_controlbutton disabled\" title=\"\" data-original-title=\"Highlight\">Highlight<\/li>\n<li class=\"meltdown_control-table meltdown_control meltdown_controlbutton disabled\" title=\"\" data-original-title=\"Table\">Table<\/li>\n<\/ul>\n<\/div>\n<div class=\"meltdown_editor-wrap\">\n<div class=\"meltdown_editor-deco\"><textarea id=\"comment_content\" class=\"js-comment-content tutorial-comment-field meltdown_editor\" disabled=\"disabled\" name=\"comment[content]\" placeholder=\"Leave a comment...\" data-markdown=\"true\"><\/textarea><\/div>\n<\/div>\n<div class=\"meltdown_bottommargin\"><\/div>\n<\/div>\n<div class=\"log-in-notice \"><a href=\"https:\/\/www.digitalocean.com\/community\/auth\/digitalocean\">Log In to Comment<\/a><\/div>\n<div class=\"clearfix\"><\/div>\n<\/form>\n<\/div>\n<div class=\"comments\">\n<ul class=\"response-list\">\n<li id=\"comment_6598\" class=\"comment-container\" data-level=\"0\">\n<div class=\"response comment-body-container    \" data-highlight=\"\">\n<div class=\"comment-upvote-container \"><button class=\"new-upvote-button\" name=\"button\" type=\"button\" data-upvotable-id=\"6598\" data-upvotable-type=\"Comment\" data-include-caret=\"true\"><span class=\"new-upvote-count\">0<\/span><\/button><\/div>\n<div class=\"ox-auto\">\n<div class=\"comment-header\"><span class=\"response-name\"><a class=\"username\" href=\"https:\/\/www.digitalocean.com\/community\/users\/ethno-urban\">ethno-urban<\/a><\/span> <span class=\"response-time\"><a class=\"post-time-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-a-postfix-e-mail-server-with-dovecot?comment=6598\" rel=\"nofollow\">November 16, 2013<\/a><\/span><\/div>\n<div class=\"response-body content-body\">\n<div class=\"legacy\">I have to put: mail_location = mbox:~\/mail:INBOX=\/var\/mail\/%u at the end of &#8220;dovecot.conf&#8221;<\/div>\n<\/div>\n<div class=\"content-actions\"><\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<\/div>\n<div class=\"response-comments\"><\/div>\n<\/li>\n<li id=\"comment_6606\" class=\"comment-container\" data-level=\"0\">\n<div class=\"response comment-body-container    \" data-highlight=\"\">\n<div class=\"comment-upvote-container \"><button class=\"new-upvote-button\" name=\"button\" type=\"button\" data-upvotable-id=\"6606\" data-upvotable-type=\"Comment\" data-include-caret=\"true\"><span class=\"new-upvote-count\">0<\/span><\/button><\/div>\n<div class=\"ox-auto\">\n<div class=\"comment-header\"><span class=\"response-name\"><a class=\"username\" href=\"https:\/\/www.digitalocean.com\/community\/users\/l-erlacher-do\">l.erlacher+do<\/a><\/span> <span class=\"response-time\"><a class=\"post-time-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-a-postfix-e-mail-server-with-dovecot?comment=6606\" rel=\"nofollow\">November 17, 2013<\/a><\/span><\/div>\n<div class=\"response-body content-body\">\n<div class=\"legacy\">Thanks for the note. I don&#8217;t have that set, that&#8217;s weird &#8211; I&#8217;ll do some testing and check it out!<\/div>\n<\/div>\n<div class=\"content-actions\"><\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<\/div>\n<div class=\"response-comments\"><\/div>\n<\/li>\n<li id=\"comment_6607\" class=\"comment-container\" data-level=\"0\">\n<div class=\"response comment-body-container    \" data-highlight=\"\">\n<div class=\"comment-upvote-container \"><button class=\"new-upvote-button\" name=\"button\" type=\"button\" data-upvotable-id=\"6607\" data-upvotable-type=\"Comment\" data-include-caret=\"true\"><span class=\"new-upvote-count\">0<\/span><\/button><\/div>\n<div class=\"ox-auto\">\n<div class=\"comment-header\"><span class=\"response-name\"><a class=\"username\" href=\"https:\/\/www.digitalocean.com\/community\/users\/l-erlacher-do\">l.erlacher+do<\/a><\/span> <span class=\"response-time\"><a class=\"post-time-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-a-postfix-e-mail-server-with-dovecot?comment=6607\" rel=\"nofollow\">November 17, 2013<\/a><\/span><\/div>\n<div class=\"response-body content-body\">\n<div class=\"legacy\">It appears you are correct &#8211; I&#8217;ll try to get that fixed in the article!<\/div>\n<\/div>\n<div class=\"content-actions\"><\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<\/div>\n<div class=\"response-comments\"><\/div>\n<\/li>\n<li id=\"comment_6621\" class=\"comment-container\" data-level=\"0\">\n<div class=\"response comment-body-container    \" data-highlight=\"\">\n<div class=\"comment-upvote-container \"><button class=\"new-upvote-button\" name=\"button\" type=\"button\" data-upvotable-id=\"6621\" data-upvotable-type=\"Comment\" data-include-caret=\"true\"><span class=\"new-upvote-count\">0<\/span><\/button><\/div>\n<div class=\"ox-auto\">\n<div class=\"comment-header\"><span class=\"response-name\"><a class=\"username\" href=\"https:\/\/www.digitalocean.com\/community\/users\/kamaln7\">kamaln7<\/a><\/span> <span class=\"mod-badge\">MOD<\/span> <span class=\"response-time\"><a class=\"post-time-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-a-postfix-e-mail-server-with-dovecot?comment=6621\" rel=\"nofollow\">November 17, 2013<\/a><\/span><\/div>\n<div class=\"response-body content-body\">\n<div class=\"legacy\">@Lukas, ethno-urban: Thanks, I&#8217;ve updated the article :]<\/div>\n<\/div>\n<div class=\"content-actions\"><\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<\/div>\n<div class=\"response-comments\"><\/div>\n<\/li>\n<li id=\"comment_6639\" class=\"comment-container\" data-level=\"0\">\n<div class=\"response comment-body-container    \" data-highlight=\"\">\n<div class=\"comment-upvote-container \"><button class=\"new-upvote-button\" name=\"button\" type=\"button\" data-upvotable-id=\"6639\" data-upvotable-type=\"Comment\" data-include-caret=\"true\"><span class=\"new-upvote-count\">0<\/span><\/button><\/div>\n<div class=\"ox-auto\">\n<div class=\"comment-header\"><span class=\"response-name\"><a class=\"username\" href=\"https:\/\/www.digitalocean.com\/community\/users\/pauldavidmena\">pauldavidmena<\/a><\/span> <span class=\"response-time\"><a class=\"post-time-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-a-postfix-e-mail-server-with-dovecot?comment=6639\" rel=\"nofollow\">November 17, 2013<\/a><\/span><\/div>\n<div class=\"response-body content-body\">\n<div class=\"legacy\">Just tested this out on my Droplet and it all worked on the first try! Thanks for the detailed instructions.<\/div>\n<\/div>\n<div class=\"content-actions\"><\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<\/div>\n<div class=\"response-comments\"><\/div>\n<\/li>\n<li id=\"comment_6696\" class=\"comment-container\" data-level=\"0\">\n<div class=\"response comment-body-container    \" data-highlight=\"\">\n<div class=\"comment-upvote-container \"><button class=\"new-upvote-button\" name=\"button\" type=\"button\" data-upvotable-id=\"6696\" data-upvotable-type=\"Comment\" data-include-caret=\"true\"><span class=\"new-upvote-count\">0<\/span><\/button><\/div>\n<div class=\"ox-auto\">\n<div class=\"comment-header\"><span class=\"response-name\"><a class=\"username\" href=\"https:\/\/www.digitalocean.com\/community\/users\/haprog\">haprog<\/a><\/span> <span class=\"response-time\"><a class=\"post-time-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-a-postfix-e-mail-server-with-dovecot?comment=6696\" rel=\"nofollow\">November 19, 2013<\/a><\/span><\/div>\n<div class=\"response-body content-body\">\n<div class=\"legacy\">Thanks! Now I finally have a self configured mail server up. \ud83d\ude42<\/div>\n<\/div>\n<div class=\"content-actions\"><\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<\/div>\n<div class=\"response-comments\"><\/div>\n<\/li>\n<li id=\"comment_6701\" class=\"comment-container\" data-level=\"0\">\n<div class=\"response comment-body-container    \" data-highlight=\"\">\n<div class=\"comment-upvote-container \"><button class=\"new-upvote-button\" name=\"button\" type=\"button\" data-upvotable-id=\"6701\" data-upvotable-type=\"Comment\" data-include-caret=\"true\"><span class=\"new-upvote-count\">0<\/span><\/button><\/div>\n<div class=\"ox-auto\">\n<div class=\"comment-header\"><span class=\"response-name\"><a class=\"username\" href=\"https:\/\/www.digitalocean.com\/community\/users\/dan106525\">dan106525<\/a><\/span> <span class=\"response-time\"><a class=\"post-time-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-a-postfix-e-mail-server-with-dovecot?comment=6701\" rel=\"nofollow\">November 19, 2013<\/a><\/span><\/div>\n<div class=\"response-body content-body\">\n<div class=\"legacy\">Is there any GUI for setting up new mail accounts so anyone don&#8217;t need to enter ssh for account creation?<\/div>\n<\/div>\n<div class=\"content-actions\"><\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<\/div>\n<div class=\"response-comments\"><\/div>\n<\/li>\n<li id=\"comment_6702\" class=\"comment-container\" data-level=\"0\">\n<div class=\"response comment-body-container    \" data-highlight=\"\">\n<div class=\"comment-upvote-container \"><button class=\"new-upvote-button\" name=\"button\" type=\"button\" data-upvotable-id=\"6702\" data-upvotable-type=\"Comment\" data-include-caret=\"true\"><span class=\"new-upvote-count\">0<\/span><\/button><\/div>\n<div class=\"ox-auto\">\n<div class=\"comment-header\"><span class=\"response-name\"><a class=\"username\" href=\"https:\/\/www.digitalocean.com\/community\/users\/l-erlacher-do\">l.erlacher+do<\/a><\/span> <span class=\"response-time\"><a class=\"post-time-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-a-postfix-e-mail-server-with-dovecot?comment=6702\" rel=\"nofollow\">November 19, 2013<\/a><\/span><\/div>\n<div class=\"response-body content-body\">\n<div class=\"legacy\">No &#8211; in this setup, mail accounts are directly tied to system users. I am working on a follow-up article to allow adding users to a database!<\/div>\n<\/div>\n<div class=\"content-actions\"><\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<\/div>\n<div class=\"response-comments\"><\/div>\n<\/li>\n<li id=\"comment_6717\" class=\"comment-container\" data-level=\"0\">\n<div class=\"response comment-body-container    \" data-highlight=\"\">\n<div class=\"comment-upvote-container \"><button class=\"new-upvote-button\" name=\"button\" type=\"button\" data-upvotable-id=\"6717\" data-upvotable-type=\"Comment\" data-include-caret=\"true\"><span class=\"new-upvote-count\">0<\/span><\/button><\/div>\n<div class=\"ox-auto\">\n<div class=\"comment-header\"><span class=\"response-name\"><a class=\"username\" href=\"https:\/\/www.digitalocean.com\/community\/users\/cyborg101010\">cyborg101010<\/a><\/span> <span class=\"response-time\"><a class=\"post-time-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-a-postfix-e-mail-server-with-dovecot?comment=6717\" rel=\"nofollow\">November 20, 2013<\/a><\/span><\/div>\n<div class=\"response-body content-body\">\n<div class=\"legacy\">Hi, For SMTP, should I use smtp.yourdomain.com, or mail.yourdomain.com? I can send mail from the server fine now, just not from a remote location.<\/div>\n<\/div>\n<div class=\"content-actions\"><\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<\/div>\n<div class=\"response-comments\"><\/div>\n<\/li>\n<li id=\"comment_6741\" class=\"comment-container\" data-level=\"0\">\n<div class=\"response comment-body-container    \" data-highlight=\"\">\n<div class=\"comment-upvote-container \"><button class=\"new-upvote-button\" name=\"button\" type=\"button\" data-upvotable-id=\"6741\" data-upvotable-type=\"Comment\" data-include-caret=\"true\"><span class=\"new-upvote-count\">0<\/span><\/button><\/div>\n<div class=\"ox-auto\">\n<div class=\"comment-header\"><span class=\"response-name\"><a class=\"username\" href=\"https:\/\/www.digitalocean.com\/community\/users\/l-erlacher-do\">l.erlacher+do<\/a><\/span> <span class=\"response-time\"><a class=\"post-time-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-a-postfix-e-mail-server-with-dovecot?comment=6741\" rel=\"nofollow\">November 20, 2013<\/a><\/span><\/div>\n<div class=\"response-body content-body\">\n<div class=\"legacy\">Postfix is running smtp directly on the mail server you configured, so at &#8216;mail.yourdomain.com&#8217;. It will accept mail for delivery to **local** mail addresses via standard smtp on port 25, and it will receive mail for delivery to **any** mail addresses via authenticated, encrypted submission server (which is also smtp, postfix just calls it submission) on port 587. Make sure that your mail client uses port 587 with plain password auth and starttls.<\/div>\n<\/div>\n<div class=\"content-actions\"><\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<\/div>\n<div class=\"response-comments\"><\/div>\n<\/li>\n<li id=\"comment_6763\" class=\"comment-container\" data-level=\"0\">\n<div class=\"response comment-body-container    \" data-highlight=\"\">\n<div class=\"comment-upvote-container \"><button class=\"new-upvote-button\" name=\"button\" type=\"button\" data-upvotable-id=\"6763\" data-upvotable-type=\"Comment\" data-include-caret=\"true\"><span class=\"new-upvote-count\">0<\/span><\/button><\/div>\n<div class=\"ox-auto\">\n<div class=\"comment-header\"><span class=\"response-name\"><a class=\"username\" href=\"https:\/\/www.digitalocean.com\/community\/users\/mkhitar-mikaelyan\">mkhitar.mikaelyan<\/a><\/span> <span class=\"response-time\"><a class=\"post-time-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-a-postfix-e-mail-server-with-dovecot?comment=6763\" rel=\"nofollow\">November 21, 2013<\/a><\/span><\/div>\n<div class=\"response-body content-body\">\n<div class=\"legacy\">Great tutorial. I have just one issue. I can send with &#8216;sendmail somebody@gmail.com&#8217;, but with &#8216;mail somebody@gmail.com&#8217; -&gt; -bash: mail: command not found. I am root user. Could you help me with this?<\/div>\n<\/div>\n<div class=\"content-actions\"><\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<\/div>\n<div class=\"response-comments\"><\/div>\n<\/li>\n<li id=\"comment_6770\" class=\"comment-container\" data-level=\"0\">\n<div class=\"response comment-body-container    \" data-highlight=\"\">\n<div class=\"comment-upvote-container \"><button class=\"new-upvote-button\" name=\"button\" type=\"button\" data-upvotable-id=\"6770\" data-upvotable-type=\"Comment\" data-include-caret=\"true\"><span class=\"new-upvote-count\">0<\/span><\/button><\/div>\n<div class=\"ox-auto\">\n<div class=\"comment-header\"><span class=\"response-name\"><a class=\"username\" href=\"https:\/\/www.digitalocean.com\/community\/users\/alexandru-vladoiu\">alexandru.vladoiu<\/a><\/span> <span class=\"response-time\"><a class=\"post-time-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-a-postfix-e-mail-server-with-dovecot?comment=6770\" rel=\"nofollow\">November 22, 2013<\/a><\/span><\/div>\n<div class=\"response-body content-body\">\n<div class=\"legacy\">I&#8217;m trying to setup a simple mail server on a debian vps with postfix and dovecot. I can send and receive email from the server via mutt but when i try to connect to IMAP via Thunderbird for example, it does not work: Nov 22 11:45:22 localhost dovecot: imap-login: Fatal: Can&#8217;t load ssl_cert: The file contains a private key (you&#8217;ve mixed ssl_cert and ssl_key settings) Nov 22 11:45:22 localhost dovecot: master: Error: service(imap-login): command startup failed, throttling for 16 secs Extract from main.cf postifx file: smtpd_tls_cert_file = \/etc\/ssl\/private\/dovecot.pem smtpd_tls_key_file = \/etc\/ssl\/private\/dovecot.key smtpd_use_tls=yes smtpd_tls_session_cache_database = btree:${data_directory}\/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}\/smtp_scache smtpd_tls_security_level=may smtpd_tls_protocols = !SSLv2, !SSLv3 Extract from dovecot.conf: protocols = &#8220;imap&#8221; protocol imap { mail_plugins = &#8221; autocreate&#8221; } plugin { autocreate = Trash autocreate2 = Sent autosubscribe = Trash autosubscribe2 = Sent } service auth { unix_listener \/var\/spool\/postfix\/private\/auth { group = postfix mode = 0660 user = postfix } } ssl=required ssl_cert =<\/div>\n<\/div>\n<div class=\"content-actions\"><\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<\/div>\n<div class=\"response-comments\"><\/div>\n<\/li>\n<li id=\"comment_6775\" class=\"comment-container\" data-level=\"0\">\n<div class=\"response comment-body-container    \" data-highlight=\"\">\n<div class=\"comment-upvote-container \"><button class=\"new-upvote-button\" name=\"button\" type=\"button\" data-upvotable-id=\"6775\" data-upvotable-type=\"Comment\" data-include-caret=\"true\"><span class=\"new-upvote-count\">0<\/span><\/button><\/div>\n<div class=\"ox-auto\">\n<div class=\"comment-header\"><span class=\"response-name\"><a class=\"username\" href=\"https:\/\/www.digitalocean.com\/community\/users\/kamaln7\">kamaln7<\/a><\/span> <span class=\"mod-badge\">MOD<\/span> <span class=\"response-time\"><a class=\"post-time-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-a-postfix-e-mail-server-with-dovecot?comment=6775\" rel=\"nofollow\">November 22, 2013<\/a><\/span><\/div>\n<div class=\"response-body content-body\">\n<div class=\"legacy\">@mkhitar.mikaelyan: Run<\/p>\n<pre>sudo apt-get install mailutils<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Postfix Introduction This tutorial will tell you how to setup a basic mail server and teach you a bit about the Postfix MTA (Mail Transfer Agent) in the process. Postfix is extremely flexible. Its architecture is based on a loose composition of services that receive emails and pass them on to other services (with services [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":621,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"class_list":["post-701","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/701","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=701"}],"version-history":[{"count":1,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/701\/revisions"}],"predecessor-version":[{"id":702,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/701\/revisions\/702"}],"up":[{"embeddable":true,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/621"}],"wp:attachment":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}