{"id":414,"date":"2018-07-20T06:53:04","date_gmt":"2018-07-20T06:53:04","guid":{"rendered":"http:\/\/linuxresellerwebhosting.in\/blog\/?p=414"},"modified":"2018-08-20T06:53:42","modified_gmt":"2018-08-20T06:53:42","slug":"how-to-install-dovecot-on-cent-os","status":"publish","type":"post","link":"https:\/\/linuxresellerwebhosting.in\/blog\/how-to-install-dovecot-on-cent-os\/","title":{"rendered":"How to Install Dovecot on Cent OS"},"content":{"rendered":"<p>Hi All,<\/p>\n<p>Today We are going to see how to install Dovecot on Cent OS.<\/p>\n<p>Now install Dovecot using the following command:<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    yum -y <span class=\"token function\">install<\/span> dovecot\r\n<\/code><\/pre>\n<p>Once Dovecot is installed, edit the following file using your favorite editor.<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    <span class=\"token function\">nano<\/span> \/etc\/dovecot\/conf.d\/10-master.conf\r\n<\/code><\/pre>\n<p>and find the following lines:<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    <span class=\"token comment\" spellcheck=\"true\"># Postfix smtp-auth<\/span>\r\n<\/code><\/pre>\n<p>Now Append the following lines, just below these lines:<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    <span class=\"token comment\" spellcheck=\"true\"># Postfix smtp-auth<\/span>\r\n    unix_listener \/var\/spool\/postfix\/private\/auth <span class=\"token punctuation\">{<\/span>\r\n    mode <span class=\"token operator\">=<\/span> 0660\r\n    user <span class=\"token operator\">=<\/span> postfix\r\n    group <span class=\"token operator\">=<\/span> postfix\r\n    <span class=\"token punctuation\">}<\/span>\r\n<\/code><\/pre>\n<p>Now open another configuration using the following command.<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    <span class=\"token function\">nano<\/span> \/etc\/dovecot\/conf.d\/10-auth.conf\r\n<\/code><\/pre>\n<p>and find the following lines.<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    <span class=\"token comment\" spellcheck=\"true\"># Space separated list of wanted authentication mechanisms:<\/span>\r\n    <span class=\"token comment\" spellcheck=\"true\">#   plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp skey<\/span>\r\n    <span class=\"token comment\" spellcheck=\"true\">#   gss-spnego<\/span>\r\n    <span class=\"token comment\" spellcheck=\"true\"># NOTE: See also disable_plaintext_auth setting.<\/span>\r\n    auth_mechanisms <span class=\"token operator\">=<\/span> plain\r\n<\/code><\/pre>\n<p>Append\u00a0<code>login<\/code>\u00a0at the end of the line\u00a0<code>auth_mechanisms = plain<\/code>\u00a0to make it look like<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    auth_mechanisms <span class=\"token operator\">=<\/span> plain login\r\n<\/code><\/pre>\n<p>Again edit\u00a0<code>\/etc\/dovecot\/conf.d\/10-mail.conf<\/code>\u00a0file using your favorite editor.<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    <span class=\"token function\">nano<\/span> \/etc\/dovecot\/conf.d\/10-mail.conf\r\n<\/code><\/pre>\n<p>Find the following lines<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    <span class=\"token comment\" spellcheck=\"true\"># <\/span>\r\n    <span class=\"token comment\" spellcheck=\"true\">#<\/span>\r\n    <span class=\"token comment\" spellcheck=\"true\">#mail_location =<\/span>\r\n<\/code><\/pre>\n<p>Now add the following line just below these lines:<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    mail_location <span class=\"token operator\">=<\/span> maildir:~\/mail\r\n<\/code><\/pre>\n<p>Now edit\u00a0<code>\/etc\/dovecot\/conf.d\/20-pop3.conf<\/code>\u00a0using your favorite editor.<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    <span class=\"token function\">nano<\/span> \/etc\/dovecot\/conf.d\/20-pop3.conf\r\n<\/code><\/pre>\n<p>and find the following lines.<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    <span class=\"token comment\" spellcheck=\"true\">#pop3_uidl_format = %08Xu%08Xv<\/span>\r\n<\/code><\/pre>\n<p>Uncomment the above line to make it look like as shown below.<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    <span class=\"token comment\" spellcheck=\"true\"># Note that Outlook 2003 seems to have problems with %v.%u format which was<\/span>\r\n    <span class=\"token comment\" spellcheck=\"true\"># Dovecot's default, so if you're building a new server it would be a good<\/span>\r\n    <span class=\"token comment\" spellcheck=\"true\"># idea to change this. %08Xu%08Xv should be pretty fail-safe.<\/span>\r\n    <span class=\"token comment\" spellcheck=\"true\">#<\/span>\r\n    pop3_uidl_format <span class=\"token operator\">=<\/span> %08Xu%08Xv \r\n<\/code><\/pre>\n<p>Now restart postfix, and dovecot using the following command.<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    systemctl restart postfix\r\n    systemctl <span class=\"token function\">enable<\/span> postfix\r\n    systemctl restart dovecot\r\n    systemctl <span class=\"token function\">enable<\/span> dovecot\r\n<\/code><\/pre>\n<p>Now if you have a firewall running you will need to allow port number 25, 587, 465, 110, 143, 993, 995 and 80. All the ports except 80 are used to send and receive emails and port 80 is used to make HTTP connections. HTTP connections will be used to access Squirrelmail using web interface.<\/p>\n<p>To unblock all these ports from firewall, run the following commands.<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    firewall-cmd --permanent --add-service<span class=\"token operator\">=<\/span>smtp\r\n    firewall-cmd --permanent --add-port<span class=\"token operator\">=<\/span>587\/tcp\r\n    firewall-cmd --permanent --add-port<span class=\"token operator\">=<\/span>465\/tcp\r\n    firewall-cmd --permanent --add-port<span class=\"token operator\">=<\/span>110\/tcp\r\n    firewall-cmd --permanent --add-service<span class=\"token operator\">=<\/span>pop3s\r\n    firewall-cmd --permanent --add-port<span class=\"token operator\">=<\/span>143\/tcp\r\n    firewall-cmd --permanent --add-service<span class=\"token operator\">=<\/span>imaps\r\n    firewall-cmd --permanent --add-service<span class=\"token operator\">=<\/span>http\r\n    firewall-cmd --reload\r\n<\/code><\/pre>\n<h3>Testing Postfix and Dovecot<\/h3>\n<p>You can check if Postfix is working by executing the following command in your terminal.<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    telnet mail.yourdomain.com smtp\r\n<\/code><\/pre>\n<p>If you do not have telnet installed, then you can run the following command to install telnet.<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    yum -y <span class=\"token function\">install<\/span> telnet\r\n<\/code><\/pre>\n<p>Once you are connected using telnet you will see following output.<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    Trying ::1<span class=\"token punctuation\">..<\/span>.\r\n    Connected to localhost.\r\n    Escape character is <span class=\"token string\">'^]'<\/span><span class=\"token keyword\">.<\/span>\r\n    220 mail.rackvoucher.com ESMTP Postfix\r\n<\/code><\/pre>\n<p>Now you can also send email using telnet. Use the following command to enter the sender username.<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    mail from:\r\n<\/code><\/pre>\n<p>To enter the email of recipient, you can use the use the following command.<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    rcpt to:\r\n<\/code><\/pre>\n<p>To enter the body of email, enter the following command.<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    data\r\n<\/code><\/pre>\n<p>Once you have entered your message, enter dot (.) to finish the message. Finally enter\u00a0<code>quit<\/code>\u00a0to exit telnet.<\/p>\n<p>To test Dovecot, enter the following command.<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    telnet mail.yourdomain.com pop3\r\n<\/code><\/pre>\n<p>You will see following output,<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">    Trying 104.36.18.239<span class=\"token punctuation\">..<\/span>.\r\n    Connected to mail.rackvoucher.com.\r\n    Escape character is <span class=\"token string\">'^]'<\/span><span class=\"token keyword\">.<\/span>\r\n    +OK Dovecot ready.\r\n<\/code><\/pre>\n<p>It tells that Dovecot is working fine, you can login to your mail account by providing\u00a0<code>login<\/code>\u00a0command, then use\u00a0<code>pass<\/code>\u00a0command to enter your password. To view the mails in your account, use\u00a0<code>retr<\/code>\u00a0command.<\/p>\n<pre class=\"language-bash\"><code class=\" language-bash\">    user mailuser\r\n    +OK\r\n    pass Password\r\n    +OK Logged in.\r\n    retr\r\n    -ERR There's no message 1.\r\n    quit\r\n    +OK Logging out.\r\n    Connection closed by foreign host.<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>Thanks for reading this tutorial \ud83d\ude42<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi All, Today We are going to see how to install Dovecot on Cent OS. Now install Dovecot using the<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[1],"tags":[],"class_list":["post-414","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/414","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/comments?post=414"}],"version-history":[{"count":3,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/414\/revisions"}],"predecessor-version":[{"id":427,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/414\/revisions\/427"}],"wp:attachment":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/media?parent=414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/categories?post=414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/tags?post=414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}