{"id":7109,"date":"2013-06-19T07:00:00","date_gmt":"2013-06-19T05:00:00","guid":{"rendered":"http:\/\/nolabnoparty.com\/?p=7109"},"modified":"2014-12-15T08:23:15","modified_gmt":"2014-12-15T07:23:15","slug":"setup-mail-server-postfix-dovecot-roundcube-centos","status":"publish","type":"post","link":"https:\/\/nolabnoparty.com\/en\/setup-mail-server-postfix-dovecot-roundcube-centos\/","title":{"rendered":"Setup mail server with Postfix, Dovecot, Roundcube"},"content":{"rendered":"<p><img decoding=\"async\" style=\"background-image: none; margin: 10px auto 5px; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border: 0px;\" title=\"postfix01\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix01.jpg\" alt=\"postfix01\" width=\"602\" height=\"202\" border=\"0\" \/><\/p>\n<p>A working mail server can be configured using Postfix (MTA) with the addition of some components like Dovecot (IMAP) and Roundcube (webmail).<\/p>\n<p>Combining these applications we obtain an email system with <strong>SMTP, IMAP, POP3 protocols<\/strong> that can be used in a corporate environment where the budget is pretty limited. This solution is based on Open Source software where <strong>no licenses<\/strong> need to be purchased for its use.<\/p>\n<p><!--more--><\/p>\n<p>&nbsp;<\/p>\n<h2>Prerequisites<\/h2>\n<ul>\n<li><a href=\"http:\/\/www.centos.org\/\" target=\"_blank\" rel=\"noopener\">CentOS 6<\/a>: minimal installation<\/li>\n<li><a href=\"http:\/\/www.postfix.org\/\" target=\"_blank\" rel=\"noopener\">Postfix<\/a>: SMTP<\/li>\n<li><a href=\"http:\/\/www.dovecot.org\/\" target=\"_blank\" rel=\"noopener\">Dovecot<\/a>: IMAP, POP3<\/li>\n<li><a href=\"http:\/\/roundcube.net\/\" target=\"_blank\" rel=\"noopener\">Roundcube<\/a>: web-based IMAP client<\/li>\n<li><a href=\"http:\/\/postfixadmin.sourceforge.net\/\" target=\"_blank\" rel=\"noopener\">Postfix admin<\/a>: to easily manage Postfix<\/li>\n<\/ul>\n<p>To work properly, system needs to have <strong>selinux disabled<\/strong>.<\/p>\n<p><span style=\"color: #0000a0;\"># vi \/etc\/selinux\/config<\/span><\/p>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix02\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix02.jpg\" alt=\"postfix02\" width=\"600\" height=\"164\" border=\"0\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>Install Postfix<\/h2>\n<p>From the console, install Postfix with <em>yum<\/em> command.<\/p>\n<p><span style=\"color: #0000a0;\"># yum install postfix<\/span><\/p>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix03\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix03.jpg\" alt=\"postfix03\" width=\"600\" height=\"271\" border=\"0\" \/><\/p>\n<p>Edit <strong>configuration file<\/strong> <em>\/etc\/postfix\/main.cf<\/em> and set the parameters as follow:<\/p>\n<pre class=\"brush: shell; gutter: true\">myhostname = hostname.domain.com \r\nmydomain = domain.com \r\nmyorigin = $mydomain \r\ninet_interfaces = all \r\nmydestination = $myhostname, localhost.$mydomain, localhost, $mydomain \r\nmynetworks = 192.168.1.0\/24, 127.0.0.0\/8 \r\nhome_mailbox = Maildir\/<\/pre>\n<p><span style=\"color: #0000a0;\"># vi \/etc\/postfix\/main.cf<\/span><\/p>\n<pre class=\"brush: shell; gutter: true\">myhostname = hostname.domain.com \r\nmydomain = domain.com \r\nmyorigin = $mydomain<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix04\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix04.jpg\" alt=\"postfix04\" width=\"600\" height=\"150\" border=\"0\" \/><\/p>\n<pre class=\"brush: shell; gutter: true\">inet_interfaces = all<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix05\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix05.jpg\" alt=\"postfix05\" width=\"600\" height=\"264\" border=\"0\" \/><\/p>\n<pre class=\"brush: shell; gutter: true\">mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix06\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix06.jpg\" alt=\"postfix06\" width=\"600\" height=\"196\" border=\"0\" \/><\/p>\n<pre class=\"brush: shell; gutter: true\">mynetworks = 192.168.1.0\/24, 127.0.0.0\/8<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix07\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix07.jpg\" alt=\"postfix07\" width=\"600\" height=\"119\" border=\"0\" \/><\/p>\n<pre class=\"brush: shell; gutter: true\">home_mailbox = Maildir\/<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix08\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix08.jpg\" alt=\"postfix08\" width=\"600\" height=\"152\" border=\"0\" \/><\/p>\n<p>Once all the parameters have been set, set application to start during <strong>system boot<\/strong> and start the service.<\/p>\n<p><span style=\"color: #0000a0;\"># chkconfig postfix on<br \/>\n# service postfix start<\/span><\/p>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix09\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix09.jpg\" alt=\"postfix09\" width=\"600\" height=\"62\" border=\"0\" \/><\/p>\n<p>&nbsp;<\/p>\n<h4>Testing Postfix<\/h4>\n<p>To check if everything works as expected, type from console the following commands to <strong>send an email<\/strong>:<\/p>\n<p><span style=\"color: #0000a0;\"># telnet localhost smtp <\/span><\/p>\n<pre class=\"lang:default decode:true brush: shell; gutter: true\">Trying ::1... \r\nConnected to localhost. \r\nEscape character is '^]'. \r\n220 server.domain.com ESMTP Postfix \r\nehlo localhost \r\n250-server.domain.com \r\n250-PIPELINING \r\n250-SIZE 10240000 \r\n250-VRFY \r\n250-ETRN \r\n250-ENHANCEDSTATUSCODES \r\n250-8BITMIME \r\n250 DSN \r\nmail from: username@domain.com\r\n250 2.1.0 Ok \r\nrcpt to: username@domain.com\r\n250 2.1.5 Ok \r\ndata \r\n354 End data with &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt; \r\ntest\r\n.\r\n250 2.0.0 Ok: queued as 2C55A94 \r\nquit\r\n221 2.0.0 Bye \r\nConnection closed by foreign host.<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix10\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix10.jpg\" alt=\"postfix10\" width=\"600\" height=\"441\" border=\"0\" \/><\/p>\n<p>To check if the\u00a0<strong>email has been received<\/strong>, have a look at the <em>\/home\/username\/Maildir\/new<\/em> directory.<\/p>\n<p><span style=\"color: #0000a0;\"># cd \/home\/<span style=\"color: #ff0000;\"><strong>username<\/strong><\/span>\/Maildir\/new\/<br \/>\n# ll<br \/>\n# cat xxxxx.xxxxx.server.domain.com<\/span><\/p>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix11\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix11.jpg\" alt=\"postfix11\" width=\"600\" height=\"338\" border=\"0\" \/><\/p>\n<p>The email was<strong> received by the system<\/strong> then the mail server is working properly.<\/p>\n<p>&nbsp;<\/p>\n<h2>Install Dovecot<\/h2>\n<p>While Postfix acts as <span style=\"text-align: left; text-transform: none; background-color: #ffffff; text-indent: 0px; letter-spacing: normal; display: inline !important; font: small\/16px arial, sans-serif; white-space: normal; float: none; color: #444444; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">Mail Transfer Agent (MTA) <\/span>only, in order to retrieve emails using modern tools we need to <strong>enable IMAP\/POP3<\/strong> protocols. Dovecot is an application that acts as a secure <strong>IMAP and POP3 server<\/strong>.<\/p>\n<p>Use the <em>yum<\/em> command to install Dovecot.<\/p>\n<p><span style=\"color: #0000a0;\"># yum install dovecot<\/span><\/p>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix12\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix12.jpg\" alt=\"postfix12\" width=\"600\" height=\"178\" border=\"0\" \/><br \/>\nEdit the configuration file <em>\/etc\/dovecot\/dovecot.conf <\/em>to enable the <strong>needed protocols<\/strong>.<\/p>\n<p><span style=\"color: #0000a0;\"># vi \/etc\/dovecot\/dovecot.conf<\/span><\/p>\n<pre class=\"brush: shell; gutter: true\">protocols = imap pop3 lmtp<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix13\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix13.jpg\" alt=\"postfix13\" width=\"600\" height=\"44\" border=\"0\" \/><\/p>\n<p>Then we need to specify the mail location by editing the file <em>\/etc\/dovecot\/conf.d\/10-mail.conf<\/em>.<\/p>\n<p><span style=\"color: #000080;\"># vi \/etc\/dovecot\/conf.d\/10-mail.conf<\/span><\/p>\n<pre class=\"brush: shell; gutter: true\">mail_location = maildir:~\/Maildir<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix14\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix14.jpg\" alt=\"postfix14\" width=\"600\" height=\"153\" border=\"0\" \/><br \/>\nEdit the file <em>\/etc\/dovecot\/conf.d\/10-auth.conf<\/em> and set the following parameters:<\/p>\n<p><span style=\"color: #0000a0;\"># vi \/etc\/dovecot\/conf.d\/10-auth.conf<\/span><\/p>\n<pre class=\"brush: shell; gutter: true\">disable_plaintext_auth = no<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix15\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix15.jpg\" alt=\"postfix15\" width=\"600\" height=\"89\" border=\"0\" \/><\/p>\n<pre class=\"brush: shell; gutter: true\">auth_mechanisms = plain login<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix16\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix16.jpg\" alt=\"postfix16\" width=\"600\" height=\"91\" border=\"0\" \/><\/p>\n<p>Last file to edit <em>\/etc\/dovecot\/conf.d\/10-master.conf<\/em>.<\/p>\n<p><span style=\"color: #0000a0;\"># vi \/etc\/dovecot\/conf.d\/10-master.conf<\/span><\/p>\n<pre class=\"brush: shell; gutter: true\">unix_listener auth-userdb { \r\n\u00a0\u00a0\u00a0 #mode = 0600 \r\n\u00a0\u00a0\u00a0 user = postfix \r\n\u00a0\u00a0\u00a0 group = postfix \r\n}<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix17\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix17.jpg\" alt=\"postfix17\" width=\"600\" height=\"234\" border=\"0\" \/><\/p>\n<p>Set Dovecot to <strong>start at system boot<\/strong> and start the service.<\/p>\n<p><span style=\"color: #0000a0;\"># chkconfig dovecot on<br \/>\n# service dovecot start<\/span><\/p>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix18\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix18.jpg\" alt=\"postfix18\" width=\"600\" height=\"63\" border=\"0\" \/><\/p>\n<p>&nbsp;<\/p>\n<h4>Testing Dovecot<\/h4>\n<p>To check if Dovecot is working, we test the program through the <strong>POP3 protocol<\/strong>.<\/p>\n<p><span style=\"color: #0000a0;\"># telnet localhost pop3<\/span><\/p>\n<pre class=\"lang:default decode:true brush: shell; gutter: true  \">Trying ::1... \r\nConnected to localhost. \r\nEscape character is '^]'. \r\n+OK Dovecot ready. \r\nuser admin \r\n+OK \r\npass password \r\n+OK Logged in. \r\nlist\r\n+OK 1 messages: \r\n1 477 \r\n. \r\nretr 1 \r\n+OK 477 octets \r\nReturn-Path: &lt;username@domain.com&gt; \r\nX-Original-To: username@domain.com \r\nDelivered-To: username@domain.com \r\nReceived: from localhost (localhost [IPv6:::1]) \r\nby server.domain.com (Postfix) with ESMTP id 2C55A94 \r\nfor username@domain.com; Wed, 12 Jun 2013 12:22:00 +0200 (CEST) \r\nMessage-Id: &lt;20130207113547.117113FF18@server.domain.com&gt; \r\nDate: Wed, 12 Jun 2013 12:22:00 +0200 (CEST) \r\nFrom: username@domain.com \r\nTo: undisclosed-recipients:; \r\ntest postfix \r\n. \r\nquit\r\n+OK Logging out. \r\nConnection closed by foreign host.<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix19\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix19.jpg\" alt=\"postfix19\" width=\"600\" height=\"529\" border=\"0\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>Install Roundcube<\/h2>\n<p>Roundcube is a <strong>browser-based IMAP client<\/strong> with an application-like user interface.<\/p>\n<p>To configure the application, firstly we need to install <strong>MySQL server and Apache<\/strong> in the system.<\/p>\n<p><span style=\"color: #0000a0;\"># yum install mysql-server mysql-devel httpd<\/span><\/p>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix20\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix20.jpg\" alt=\"postfix20\" width=\"600\" height=\"242\" border=\"0\" \/><\/p>\n<p>Enable both MySQL and Apache to <strong>start at system boot<\/strong> and enable services.<\/p>\n<p><span style=\"color: #0000a0;\"># chkconfig mysqld on<br \/>\n# service mysqld start<br \/>\n<\/span><\/p>\n<p><span style=\"color: #0000a0;\"># chkconfig httpd on<br \/>\n# service httpd start<\/span><\/p>\n<p>&nbsp;<\/p>\n<h4>Install EPEL repository<\/h4>\n<p>To install Roundcube with <em>yum<\/em> command, we need to install the <strong>EPEL repository<\/strong> in the system.<\/p>\n<p><span style=\"color: #0000a0;\"># wget http:\/\/dl.fedoraproject.org\/pub\/epel\/6\/x86_64\/epel-release-6-8.noarch.rpm<br \/>\n# rpm -ivh epel-release-6-8.noarch.rpm<\/span><\/p>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix21\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix21.jpg\" alt=\"postfix21\" width=\"600\" height=\"369\" border=\"0\" \/><\/p>\n<p>Once EPEL repo has been installed, use\u00a0<em>yum<\/em>\u00a0to install Roundcube.<\/p>\n<p><span style=\"color: #0000a0;\"># yum install roundcubemail<\/span><\/p>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix22\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix22.jpg\" alt=\"postfix22\" width=\"600\" height=\"225\" border=\"0\" \/><\/p>\n<p>&nbsp;<\/p>\n<h4>Configure MySQL<\/h4>\n<p>To <strong>define the database<\/strong> used by the application, we need to access MySQL configuration.<\/p>\n<p><span style=\"color: #0000a0;\"># mysql -u root -p<br \/>\n<\/span><\/p>\n<pre class=\"brush: shell; gutter: true\">mysql&gt; create database roundcube; \r\nmysql&gt; create user roundcube; \r\nmysql&gt; GRANT ALL PRIVILEGES ON roundcube.* TO roundcube@localhost IDENTIFIED BY 'password'; \r\nmysql&gt; flush privileges; \r\nmysql&gt; use roundcube; \r\nmysql&gt; source \/usr\/share\/doc\/roundcubemail-0.8.6\/SQL\/mysql.initial.sql \r\nmysql&gt; quit<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix23\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix23.jpg\" alt=\"postfix23\" width=\"600\" height=\"349\" border=\"0\" \/><\/p>\n<p>Edit configuration file <em>\/etc\/roundcubemail\/db.inc.php<\/em> to set the parameters to <strong>access the database<\/strong>.<\/p>\n<p><span style=\"color: #0000a0;\"># vi \/etc\/roundcubemail\/db.inc.php<\/span><\/p>\n<pre class=\"brush: shell; gutter: true\">$rcmail_config['db_dsnw'] = 'mysql:\/\/roundcube:password@localhost\/roundcube';<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix24\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix24.jpg\" alt=\"postfix24\" width=\"600\" height=\"156\" border=\"0\" \/><\/p>\n<p>Edit the file \/etc\/roundcubemail\/main.inc.php to set the hostname chosen to <strong>perform the login<\/strong>.<\/p>\n<p><span style=\"color: #0000a0;\"># vi \/etc\/roundcubemail\/main.inc.php<\/span><\/p>\n<pre class=\"brush: shell; gutter: true\">$rcmail_config['default_host'] = 'localhost';<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix25\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix25.jpg\" alt=\"postfix25\" width=\"600\" height=\"260\" border=\"0\" \/><\/p>\n<p>To make the <strong>system accessible<\/strong> outside the server, edit the file <em>\/etc\/httpd\/conf.d\/roundcubemail.conf<\/em> and set the correct parameter.<\/p>\n<p><span style=\"color: #0000a0;\"># vi \/etc\/httpd\/conf.d\/roundcubemail.conf<\/span><\/p>\n<pre class=\"brush: shell; gutter: true\">Allow from all<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix26\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix26.jpg\" alt=\"postfix26\" width=\"600\" height=\"325\" border=\"0\" \/><\/p>\n<p>Edit the <em>\/etc\/php.ini<\/em> file and set the <strong>time zone<\/strong>.<\/p>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix27\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix27.jpg\" alt=\"postfix27\" width=\"600\" height=\"138\" border=\"0\" \/><\/p>\n<p>Because the log could report <strong>errors related to encryption<\/strong>, set the correct encryption parameter.<\/p>\n<p><span style=\"color: #0000a0;\"># vi \/etc\/php.d\/mcrypt.ini<\/span><\/p>\n<pre class=\"brush: shell; gutter: true\">extension=mcrypt.so<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix28\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix28.jpg\" alt=\"postfix28\" width=\"600\" height=\"55\" border=\"0\" \/><\/p>\n<p>Restart Apache.<\/p>\n<p><span style=\"color: #0000a0;\"># service httpd restart<\/span><\/p>\n<p>&nbsp;<\/p>\n<h4>Testing Roundcube<\/h4>\n<p>Access Roundcube typing from your browser the address:<\/p>\n<blockquote><p><span style=\"color: #ff0000;\">http:\/\/IP_address\/roundcubemail<\/span><\/p><\/blockquote>\n<p>Enter your credential then click <strong>Login<\/strong>.<\/p>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix29\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix29.jpg\" alt=\"postfix29\" width=\"546\" height=\"268\" border=\"0\" \/><\/p>\n<p>The <strong>main screen<\/strong> appears showing the email received when Postfix was previously tested.<\/p>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix30\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix30.jpg\" alt=\"postfix30\" width=\"600\" height=\"420\" border=\"0\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>Install Postfix Admin<\/h2>\n<p>To make <strong>Postfix administration easier<\/strong>, the Postfix admin is a web-based tool used to manage mailboxes, virtual domains and aliases.<\/p>\n<p>If not already present in the system, install the <strong>PHP component<\/strong> needed by the application.<\/p>\n<p><span style=\"color: #0000a0;\"># yum install php-imap<\/span><\/p>\n<p>Access MySQL and <strong>create the database<\/strong> used by Postfix Admin.<\/p>\n<p><span style=\"color: #0000a0;\"># mysql -u root -p<\/span><\/p>\n<pre class=\"brush: shell; gutter: true\">mysql&gt; create database postfixadmin; \r\nmysql&gt; grant all privileges on postfixadmin.* to postfixadmin@'localhost' identified by 'password'; \r\nmysql&gt; flush privileges; \r\nmysql&gt; quit<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix31\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix31.jpg\" alt=\"postfix31\" width=\"600\" height=\"212\" border=\"0\" \/><\/p>\n<p>Using the <em>wget<\/em> command, <strong>download<\/strong> the latest release of the application.<\/p>\n<p><span style=\"color: #0000a0;\"># wget http:\/\/downloads.sourceforge.net\/project\/postfixadmin\/postfixadmin\/postfixadmin-2.3.6\/postfixadmin-2.3.6.tar.gz<\/span><\/p>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix32\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix32.jpg\" alt=\"postfix32\" width=\"600\" height=\"351\" border=\"0\" \/><\/p>\n<p>Extract the content and <strong>move the directory<\/strong> to <em>\/var\/www\/html<\/em> folder.<\/p>\n<p><span style=\"color: #0000a0;\"># tar -vxzf postfixadmin-2.3.6.tar.gz<br \/>\n# mv postfixadmin-2.3.6 \/var\/www\/html\/postfixadmin<\/span><\/p>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix33\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix33.jpg\" alt=\"postfix33\" width=\"600\" height=\"48\" border=\"0\" \/><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix36\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix36.jpg\" alt=\"postfix36\" width=\"600\" height=\"43\" border=\"0\" \/><\/p>\n<p>Edit the configuration file <em>\/var\/www\/html\/postfixadmin\/config.inc.php<\/em> to <strong>enable the application<\/strong> and set the password.<\/p>\n<p><span style=\"color: #0000a0;\"># vi \/var\/www\/html\/postfixadmin\/config.inc.php<\/span><\/p>\n<pre class=\"brush: shell; gutter: true\">$CONF['configured'] = true; \r\n$CONF['setup_password'] = 'password';<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix34\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix34.jpg\" alt=\"postfix34\" width=\"600\" height=\"101\" border=\"0\" \/><\/p>\n<p>Set the correct <strong>parameters to access the database<\/strong> previously created.<\/p>\n<pre class=\"brush: shell; gutter: true\">$CONF['database_type'] = 'mysqli'; \r\n$CONF['database_host'] = 'localhost'; \r\n$CONF['database_user'] = 'postfixadmin'; \r\n$CONF['database_password'] = 'password'; \r\n$CONF['database_name'] = 'postfixadmin';<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix35\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix35.jpg\" alt=\"postfix35\" width=\"600\" height=\"148\" border=\"0\" \/><\/p>\n<p>Add the following line to allow the creation of the <strong>administration password<\/strong>.<\/p>\n<pre class=\"brush: shell; gutter: true\">$CONF['setup_password'] = '8abd38580e77ebf7010eb60b95eb4fad:0bd829114d9efc4bc35c7e42cf7d3507dad8b837';<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix36\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix361.jpg\" alt=\"postfix36\" width=\"600\" height=\"43\" border=\"0\" \/><\/p>\n<p>Restart Apache.<\/p>\n<p><span style=\"color: #0000a0;\"># service httpd restart<\/span><\/p>\n<p>To execute the <strong>Postfix Admin Setup Checker<\/strong>, type in your browser the address:<\/p>\n<blockquote><p><span style=\"color: #ff0000;\">http:\/\/IP_address\/postfixadmin\/setup.php<\/span><\/p><\/blockquote>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix37\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix37.jpg\" alt=\"postfix37\" width=\"588\" height=\"725\" border=\"0\" \/><\/p>\n<p>Change the <strong>setup password<\/strong>.<\/p>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix38\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix38.jpg\" alt=\"postfix38\" width=\"502\" height=\"113\" border=\"0\" \/><\/p>\n<p>Create the <strong>Superadmin account<\/strong> by filling the fields at the bottom of the screen. Click <strong>Add Admin<\/strong>.<\/p>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix39\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix39.jpg\" alt=\"postfix39\" width=\"600\" height=\"590\" border=\"0\" \/><\/p>\n<p>The Superadmin account is then created.<\/p>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix40\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix40.jpg\" alt=\"postfix40\" width=\"502\" height=\"196\" border=\"0\" \/><\/p>\n<p>To <strong>access the Administration interface<\/strong>, type in your browser the address:<\/p>\n<blockquote><p><span style=\"color: #ff0000;\">http:\/\/IP_address\/postfixadmin<\/span><\/p><\/blockquote>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix41\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix41.jpg\" alt=\"postfix41\" width=\"600\" height=\"305\" border=\"0\" \/><\/p>\n<p>The Postfix Admin main screen.<\/p>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix42\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix42.jpg\" alt=\"postfix42\" width=\"600\" height=\"235\" border=\"0\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>Sending emails through a relay<\/h2>\n<p>If the corporate network has an antispam system to check<strong> inbound and outbound emails<\/strong>, Postfix needs to be configured in order to <strong>relay the emails<\/strong> to the antispam.<\/p>\n<p>To allow the correct <strong>emails flow<\/strong>, set the <strong>relayhost<\/strong> field with the address of the antispam system.<\/p>\n<p><span style=\"color: #0000a0;\"># vi \/etc\/postfix\/main.cf<\/span><\/p>\n<pre class=\"brush: shell; gutter: true\">relayhost= lx-antispam02.nolabnoparty.local<\/pre>\n<p><img decoding=\"async\" style=\"background-image: none; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;\" title=\"postfix43\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2013\/06\/postfix43.jpg\" alt=\"postfix43\" width=\"600\" height=\"136\" border=\"0\" \/><\/p>\n<p>The mail server is now up and running with the basic functions to<strong> properly manage email<\/strong> messages.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/images\/firma.jpg\" alt=\"\" title=\"\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A working mail server can be configured using Postfix (MTA) with the addition of some components like Dovecot (IMAP) and Roundcube (webmail). Combining these applications we obtain an email system with SMTP, IMAP, POP3 protocols that can be used in a corporate environment where the budget is pretty limited. This solution is based on Open Source software where no licenses need to be purchased for its use.<\/p>\n","protected":false},"author":3,"featured_media":7110,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rop_custom_images_group":[],"rop_custom_messages_group":[],"rop_publish_now":"initial","rop_publish_now_accounts":{"linkedin_93tdZWzMZc_93tdZWzMZc":"","facebook_2879994398731222_17841400390232720":"","twitter_113568041_113568041":"","mastodon_115463926174894442_115463926174894442":""},"rop_publish_now_history":[],"rop_publish_now_status":"pending","footnotes":""},"categories":[650,534],"tags":[591,618,619],"class_list":["post-7109","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mail-services-en","category-messaging-en","tag-centos-6-en","tag-mail-server-en","tag-postfix-en","has_thumb"],"_links":{"self":[{"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/posts\/7109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/comments?post=7109"}],"version-history":[{"count":0,"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/posts\/7109\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/media\/7110"}],"wp:attachment":[{"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/media?parent=7109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/categories?post=7109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/tags?post=7109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}