{"id":51100,"date":"2020-04-15T10:50:15","date_gmt":"2020-04-15T07:50:15","guid":{"rendered":"https:\/\/computingforgeeks.com\/?p=51100"},"modified":"2023-09-07T01:55:39","modified_gmt":"2023-09-06T22:55:39","slug":"how-to-setup-mail-server-on-centos","status":"publish","type":"post","link":"https:\/\/computingforgeeks.com\/how-to-setup-mail-server-on-centos\/","title":{"rendered":"Setup Mail Server on CentOS 8 With Postfix, Dovecot, MySQL and RoundCube"},"content":{"rendered":"\n<p>In order to set up a full simple mail server, this guide takes advantage of Postfix as an SMTP server, Dovecot to provide POP\/IMAP functionality, and RoundCube as a webmail program or client so that users can check and receive email from their favorite web browsers. In this article we&#8217;re going to perform an installation of Mail Server on CentOS 8 With Postfix, Dovecot, MySQL and RoundCube.<\/p>\n\n\n\n<p>To clear all the jargon, let us get to know what the compnents we are going to use are.<\/p>\n\n\n\n<p><strong>Dovecot:<\/strong> Dovecot is an open-source IMAP and POP3 email server for Linux\/UNIX-like systems, written with security primarily in mind.<br><strong>Postfix:<\/strong> Postfix is a free and open-source mail transfer agent (MTA) that routes and delivers electronic mail from one server to another over the internet.<br><strong>Roundcube:<\/strong> Once the mails have been delivered into a mailbox, most users would need an easy to use interface to read their mails. Roundcube does this pretty well. It is a browser-based multilingual IMAP client with an application-like user interface. It provides full functionality you expect from an email client, including MIME support, address book, folder manipulation, message searching and spell checking.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-pre-requisites-for-production-use\">Pre-requisites for Production use<\/h3>\n\n\n\n<p>In order to use the server for production use, you must ensure you have the following<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You must have a Fully Qualifed Domain Name (FQDN)<\/li>\n\n\n\n<li>Create A and MX Records for your Domain in a Public Domain Name Server. These records must point to the Public IP of your server.<\/li>\n<\/ul>\n\n\n\n<p>Now that we are on the same page, it is time we get into the part where they all come and work together. The order is a bit mixed up but please understand and make sure each configuration is correct.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-1-update-set-your-hostname-and-disable-selinux\">Step 1: Update, set hostname and disable SELinux<\/h2>\n\n\n\n<p>This is to ensure we start with the latest packages which ensures all previous patches are applied and hence beginning with a secure and an upto date system.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf update\nsudo hostnamectl set-hostname <span class=\"has-inline-color has-vivid-purple-color\">mail.example.com<\/span>\n\n<strong><em># Disable SELinux\n<\/em><\/strong>sudo sed -i 's\/^SELINUX=.*\/SELINUX=disabled\/g' \/etc\/selinux\/config\nsudo reboot<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-2-install-postfix-apache-and-php\">Step 2: Install postfix, Apache and PHP<\/h2>\n\n\n\n<p>We need a Mail Transfer Agent to handle the sending and delivery of mails from our mail server. Luckily, postfix does that quite well. To install postfix, run the command below once your server is back up.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install postfix postfix-mysql httpd vim policycoreutils-python-utils epel-release -y<\/code><\/pre>\n\n\n\n<p>PHP will be used by Roundcube to render the pages on your browser and hence the need to install it. Get it installed by following instructions in the guide below.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/computingforgeeks.com\/how-to-install-php-7-4-on-centos-rhel-8\/\" target=\"_blank\">How To Install PHP 7.4 on CentOS 8 \/ RHEL 8<\/a><\/li>\n<\/ul>\n\n\n\n<p>After PHP is installed, add extra PHP packages like so:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install -y php-common php-json php-xml php-mbstring php-mysqlnd<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-3-install-and-configure-mysql\">Step 3: Install and configure MySQL<\/h2>\n\n\n\n<p>We shall need a database to store and retrieve important data for both Roundcube and Postfix. Install MariaDB by following this guide:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/computingforgeeks.com\/how-to-install-mariadb-server-on-centos-rhel-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\">How To Install MariaDB Server on CentOS 8 \/ RHEL 8<\/a><\/li>\n<\/ul>\n\n\n\n<p>After MariaDB is installed, we shall continue to configure it by creating a MariaDB username and database for the Roundcube installation. Additionally, we shall create Postfix Mail accounts databse. Log into the MariaDB client with the command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u root -p<\/code><\/pre>\n\n\n\n<p>Supply your root password and create a database for Postfix Mail accounts as shown below<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>create database postfix_accounts;<\/code><\/pre>\n\n\n\n<p>Create a user with full rights for the mail accounts database we just created.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grant all on postfix_accounts.* to postfix_admin@localhost identified by '<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">StrongPassword<\/mark>';\nflush privileges;<\/code><\/pre>\n\n\n\n<p>Create a table in the database that will store the domains you would wish to host in the server.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE `postfix_accounts`.`domains_table` ( `DomainId` INT NOT NULL AUTO_INCREMENT , `DomainName` VARCHAR(50) NOT NULL , PRIMARY KEY (`DomainId`)) ENGINE = InnoDB;<\/code><\/pre>\n\n\n\n<p>Create a table in the database that will hold user accounts<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE `postfix_accounts`.`accounts_table` ( \n    `AccountId` INT NOT NULL AUTO_INCREMENT,  \n    `DomainId` INT NOT NULL,  \n    `password` VARCHAR(300) NOT NULL,  \n    `Email` VARCHAR(100) NOT NULL,  \n    PRIMARY KEY (`AccountId`),  \n    UNIQUE KEY `Email` (`Email`),  \n    FOREIGN KEY (DomainId) REFERENCES domains_table(DomainId) ON DELETE CASCADE \n) ENGINE = InnoDB;<\/code><\/pre>\n\n\n\n<p>Create a table in the database that will hold email aliases data.<\/p>\n\n\n\n<p>An alias basically allows emails sent to one account to be redirected to another account once it reaches the mail server. For example, if you would wish all <em>contact@example.com<\/em> emails to be sent to <em>admin@example.com<\/em>, you create an alias to accomplish that functionality.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE `postfix_accounts`.`alias_table` (\n    `AliasId` INT NOT NULL AUTO_INCREMENT, \n    `DomainId` INT NOT NULL, \n    `Source` varchar(100) NOT NULL, \n    `Destination` varchar(100) NOT NULL, \n    PRIMARY KEY (`AliasId`), \n    FOREIGN KEY (DomainId) REFERENCES domains_table(DomainId) ON DELETE CASCADE\n) ENGINE = InnoDB;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-add-records-to-the-tables-we-have-just-created-in-postfix-mail-accounts-database\">Add records to the tables we have just created in Postfix Mail Accounts database.<\/h4>\n\n\n\n<p>We will now add our domain, some accounts and an alias.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>INSERT INTO `postfix_accounts`.`domains_table` (DomainName) VALUES ('example.com');  \nINSERT INTO `postfix_accounts`.`accounts_table` (DomainId, password, Email) VALUES (1, ENCRYPT('Password', CONCAT('$6$', SUBSTRING(SHA(RAND()), -16))), 'tech@example.com');  \nINSERT INTO `postfix_accounts`.`accounts_table` (DomainId, password, Email) VALUES (1, ENCRYPT('Password', CONCAT('$6$', SUBSTRING(SHA(RAND()), -16))), 'jmutai@example.com');  \nINSERT INTO `postfix_accounts`.`alias_table` (DomainId, Source, Destination) VALUES (1, 'talktous@example.com', 'sales@example.com');<\/code><\/pre>\n\n\n\n<p>You can use names and passwords(strong) you prefer for:<\/p>\n\n\n\n<p><em>postfix_admin<\/em> user and <em>postfix_accounts<\/em> database name<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-create-a-database-for-roundcube-which-we-shall-install-later\">Create a database for Roundcube which we shall install later<\/h4>\n\n\n\n<p>Now that we are in the database, we can as well add roundcube&#8217;s DB as follows.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>create database roundcube;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-create-a-user-with-full-rights-for-the-database-we-just-created\">Create a user with full rights for the database we just created.<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>grant all on roundcube.* to roundcube_admin@localhost identified by 'StrongPassword';\nflush privileges;<\/code><\/pre>\n\n\n\n<p>You can use names and passwords(strong) you prefer for:<\/p>\n\n\n\n<p><em>roundcube_admin<\/em> user and <em>roundcube database<\/em> name.<\/p>\n\n\n\n<p>After that is done, log out of the database and hop onto the next step.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>quit;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-4-configure-postfix\">Step 4: Configure Postfix on CentOS 8<\/h2>\n\n\n\n<p>Let us now configure Postfix to ensure it will be able to recieve and deliver mails from our server. Its configuration files are found under \/etc\/postfix.<\/p>\n\n\n\n<p>Configure the master configuration file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vim \/etc\/postfix\/master.cf<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-uncomment-the-following-lines-in-the-file-ensure-that-the-lines-beginning-with-o-maintains-the-indentation\">Uncomment the following lines in the file. Ensure that the lines beginning with -o maintains the indentation.<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>submission inet n       -       n       -       -       smtpd\n  -o syslog_name=postfix\/submission\n  -o smtpd_tls_security_level=encrypt   ## Comment this if you have no SSL(not recommended)\n  -o smtpd_tls_auth_only=yes            ## Comment this if you have no SSL(not recommended)\n  -o smtpd_sasl_auth_enable=yes\n  -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject\n  -o milter_macro_daemon_name=ORIGINATING\n  -o smtpd_reject_unlisted_recipient=no\npickup    unix  n       -       n       60      1       pickup\ncleanup   unix  n       -       n       -       0       cleanup\nqmgr      unix  n       -       n       300     1       qmgr\ntlsmgr    unix  -       -       n       1000?   1       tlsmgr\nrewrite   unix  -       -       n       -       -       trivial-rewrite\nbounce    unix  -       -       n       -       0       bounce\ndefer     unix  -       -       n       -       0       bounce\ntrace     unix  -       -       n       -       0       bounce\nverify    unix  -       -       n       -       1       verify\nflush     unix  n       -       n       1000?   0       flush\nproxymap  unix  -       -       n       -       -       proxymap\nproxywrite unix -       -       n       -       1       proxymap\nsmtp      unix  -       -       n       -       -       smtp\nrelay     unix  -       -       n       -       -       smtp\n\nshowq     unix  n       -       n       -       -       showq\nerror     unix  -       -       n       -       -       error\nretry     unix  -       -       n       -       -       error\ndiscard   unix  -       -       n       -       -       discard\nlocal     unix  -       n       n       -       -       local\n#virtual   unix  -       n       n       -       -       virtual\nlmtp      unix  -       -       n       -       -       lmtp\nanvil     unix  -       -       n       -       1       anvil\nscache    unix  -       -       n       -       1       scache<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-add-the-following-dovecot-related-configs-at-the-bottom-of-the-file\">Add the following dovecot-related configs at the bottom of the file.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>dovecot   unix  -       n       n       -       -       pipe\n    flags=DRhu user=vmail:vmail argv=\/usr\/libexec\/dovecot\/deliver -f ${sender} -d ${recipient}<\/code><\/pre>\n\n\n\n<p>We shall install and configure dovecot later on.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-save-the-file-after-you-have-made-the-changes-above\">Save the file after you have made the changes above.<\/h3>\n\n\n\n<p>Open main.cf file<\/p>\n\n\n\n<p>The <em>\/etc\/postfix\/main.cf<\/em> file has main configuration options for Postfix installation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vim \/etc\/postfix\/main.cf<\/code><\/pre>\n\n\n\n<p>Uncomment the myhostname line and replace host.domain.tld with the server&#8217;s hostname.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>myhostname = mail.example.com<\/code><\/pre>\n\n\n\n<p>Add your domain to the mydomain line as below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mydomain = example.com   ## Input your unique domain here<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-uncomment-or-add-the-following-lines-so-that-they-do-not-have-a-sign-in-front-of-them\">Uncomment or add the following lines so that they do not have a # sign in-front of them<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>myorigin = $myhostname\ninet_interfaces = all\ninet_protocols = all\nmydestination = $myhostname, localhost.$mydomain, localhost\nsmtpd_recipient_restrictions = permit_mynetworks\nhome_mailbox = Maildir\/<\/code><\/pre>\n\n\n\n<p>Add the following configuration lines to the end of the file. As you can notice, other configurations are SSL related. If you have SSL files, copy them in a suitable location and add them as illustrated. In case you have no SSL, simply comment (<em>add # in front<\/em>) on those options so as to deactivate them.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>append_dot_mydomain = no\nbiff = no\nconfig_directory = \/etc\/postfix\ndovecot_destination_recipient_limit = 1\nmessage_size_limit = 4194304\nsmtpd_tls_key_file = \/etc\/postfix\/ssl\/yourkey.key           ##SSL Key\nsmtpd_tls_cert_file = \/etc\/postfix\/ssl\/yourcertificate.crt  ##SSL Cert\nsmtpd_use_tls=yes\nsmtpd_tls_session_cache_database = btree:${data_directory}\/smtpd_scache\nsmtp_tls_session_cache_database = btree:${data_directory}\/smtp_scache\nsmtpd_tls_security_level=may\nvirtual_transport = dovecot\nsmtpd_sasl_type = dovecot\nsmtpd_sasl_path = private\/auth<\/code><\/pre>\n\n\n\n<p>Add the following configuration as well which gives Postfix access to the account-related data we created and stored in the database in Step 3.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>virtual_mailbox_domains = mysql:\/etc\/postfix\/database-domains.cf\nvirtual_mailbox_maps = mysql:\/etc\/postfix\/database-users.cf\nvirtual_alias_maps = mysql:\/etc\/postfix\/database-alias.cf<\/code><\/pre>\n\n\n\n<p>Now let us add database configurations to those specific files as shown below. Note that the databases and tables will be created later in the next step of this guide.<\/p>\n\n\n\n<p>Allow Postfix to access domains from the database<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <span class=\"has-inline-color has-pale-pink-color\">sudo vim \/etc\/postfix\/database-domains.cf<\/span>\nuser = postfix_admin\npassword = StrongPassword\nhosts = 127.0.0.1\ndbname = postfix_accounts\nquery = SELECT 1 FROM domains_table WHERE DomainName='%s'<\/code><\/pre>\n\n\n\n<p>Allow Postfix to access user accounts from the database<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <span class=\"has-inline-color has-pale-pink-color\">sudo vim \/etc\/postfix\/database-users.cf<\/span>\nuser = postfix_admin\npassword = StrongPassword\nhosts = 127.0.0.1\ndbname = postfix_accounts\nquery = SELECT 1 FROM accounts_table WHERE Email='%s'<\/code><\/pre>\n\n\n\n<p>Allow Postfix to access email aliases from the database<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <span class=\"has-inline-color has-pale-pink-color\">sudo vim \/etc\/postfix\/database-alias.cf<\/span>\nuser = postfix_admin\npassword = StrongPassword\nhosts = 127.0.0.1\ndbname = postfix_accounts\nquery = SELECT Destination FROM alias_table WHERE Source='%s'<\/code><\/pre>\n\n\n\n<p>Change the permissions to these files<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chmod 640 \/etc\/postfix\/database-domains.cf\nsudo chmod 640 \/etc\/postfix\/database-users.cf\nsudo chmod 640 \/etc\/postfix\/database-alias.cf<\/code><\/pre>\n\n\n\n<p>And the ownership to the files like so<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chown root:postfix \/etc\/postfix\/database-domains.cf\nsudo chown root:postfix \/etc\/postfix\/database-users.cf\nsudo chown root:postfix \/etc\/postfix\/database-alias.cf<\/code><\/pre>\n\n\n\n<p>Since we have made new changes we need to restart Postfix to load the new configs.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart postfix<\/code><\/pre>\n\n\n\n<p>Now that our database is set-up, let us test if the configuration we made on Postfix are working. You should see a 1 if successful and an alias email address in the last one.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\">sudo postmap -q <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-cyan-blue-color\">example.com<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\"> mysql:\/etc\/postfix\/database-domains.cf<\/mark>\n1\n\n$ <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">sudo postmap -q <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-cyan-blue-color\">tech@example.com<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\"> mysql:\/etc\/postfix\/database-users.cf<\/mark>\n1\n\n$ <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\">sudo postmap -q<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\"> jmutai@example.com<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\"> mysql:\/etc\/postfix\/database-users.cf<\/mark>\n1\n\n$ <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">sudo postmap -q<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-cyan-blue-color\"> talktous@example.com<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\"> mysql:\/etc\/postfix\/database-alias.cf<\/mark>\nsales@example.com<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-5-install-and-configure-dovecot\">Step 5: Install and configure Dovecot<\/h2>\n\n\n\n<p>As it had been covered before, Dovecot is an open source IMAP and POP3 email server for Linux\/UNIX-like systems. These protocols offers mail users the ability to retrieve mails from the server to their local mail clients and to delete mails from the server. Install Dovecot like so:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install dovecot dovecot-mysql -y<\/code><\/pre>\n\n\n\n<p>After it is successfully installed, let us add a user and group that will be responsible for handling mails in the system.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo groupadd -g 6000 vmail \nsudo useradd -g vmail -u 6000 vmail -d \/home\/vmail -m<\/code><\/pre>\n\n\n\n<p><br>Dovecot has a number of configuration files. Let us edit them step by step ensuring every configuration is accurately captured.<\/p>\n\n\n\n<p>Open main dovecot configuration file and make sure the lines below have no # sign in from of them<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <span class=\"has-inline-color has-pale-pink-color\">sudo vim \/etc\/dovecot\/dovecot.conf<\/span>\nlisten = *, ::\nprotocols = imap pop3 lmtp\n!include conf.d\/*.conf\n!include_try local.conf\nlog_path = \/var\/log\/dovecot.log  ##Add this for logs<\/code><\/pre>\n\n\n\n<p>Next, open <em>\/etc\/dovecot\/conf.d\/10-auth.conf<\/em> file and make sure the lines below are without comments. You will notice that <em>#!include auth-system.conf.ext<\/em> is enabled by default. Comment it out leaving <em>!include auth-sql.conf.ex<\/em>t only enabled.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <span class=\"has-inline-color has-pale-pink-color\">sudo vim \/etc\/dovecot\/conf.d\/10-auth.conf<\/span>\ndisable_plaintext_auth = yes\nauth_mechanisms = plain login\n!include auth-sql.conf.ext     ## Only enable authentication through SQL and leave other authentication methods disabled<\/code><\/pre>\n\n\n\n<p>After that, we need to add configurations to the file we enabled above. That is <em>\/etc\/dovecot\/conf.d\/auth-sql.conf.ext.<\/em><\/p>\n\n\n\n<p>These are the few special variables used<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>%u &#8211; username<\/li>\n\n\n\n<li>%n &#8211; user part in user@domain, same as %u if there&#8217;s no domain<\/li>\n\n\n\n<li>%d &#8211; domain part in user@domain, empty if there&#8217;s no domain<\/li>\n\n\n\n<li>%h &#8211; home directory<\/li>\n<\/ul>\n\n\n\n<p>As you can see from the configuration below, we will be storing emails in \/home\/vmail\/.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <span class=\"has-inline-color has-pale-pink-color\">sudo vim \/etc\/dovecot\/conf.d\/auth-sql.conf.ext<\/span>\npassdb {\n  driver = sql\n  args = \/etc\/dovecot\/dovecot-sql.conf.ext\n}\nuserdb {\n  driver = static     ## Don't forget to change this\n  args = uid=vmail gid=vmail home=\/home\/vmail\/%d\/%n\/Maildir\n}<\/code><\/pre>\n\n\n\n<p>Create the \/home\/vmail\/domain  directory (<em>\/home\/vmail\/%d\/<\/em>)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkdir \/home\/vmail\/<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-cyan-blue-color\">example.com<\/mark><\/code><\/pre>\n\n\n\n<p>Let us add database details we configured for postfix in the file we included in &#8220;<em>args<\/em>&#8221; in the file above<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <span class=\"has-inline-color has-pale-pink-color\">sudo vim \/etc\/dovecot\/dovecot-sql.conf.ext<\/span>\ndriver = mysql\nconnect = \"host=127.0.0.1 dbname=postfix_accounts user=postfix_admin password=StrongPassword\"\ndefault_pass_scheme = SHA512-CRYPT\npassword_query = SELECT Email as User, password FROM accounts_table WHERE Email='%u';<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-now-we-are-going-to-configure-mailbox-locations-and-namespaces\">Now we are going to configure Mailbox locations and namespaces<\/h4>\n\n\n\n<p>Open this file <em>\/etc\/dovecot\/conf.d\/10-mail.conf<\/em> and make sure the settings are altered to be similar to the configuration below<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <span class=\"has-inline-color has-pale-pink-color\">sudo vim \/etc\/dovecot\/conf.d\/10-mail.conf<\/span>\nmail_location = maildir:\/home\/vmail\/%d\/%n\/Maildir\nnamespace inbox {\n  inbox = yes\n}\nmail_privileged_group = mail\nmbox_write_locks = fcntl<\/code><\/pre>\n\n\n\n<p>Next, open up <em>\/etc\/dovecot\/conf.d\/10-master.conf<\/em> and make the following changes to it then save.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <span class=\"has-inline-color has-pale-pink-color\">sudo vim \/etc\/dovecot\/conf.d\/10-master.conf<\/span>\nservice imap-login {\n  inet_listener imap {\n    port = 143\n  }\n  inet_listener imaps {\n  }\n}\nservice pop3-login {\n  inet_listener pop3 {\n    port = 110\n  }\n  inet_listener pop3s {\n  }\n}\nservice lmtp {\n  unix_listener \/var\/spool\/postfix\/private\/dovecot-lmtp {\n   mode = 0600\n   user = postfix\n   group = postfix\n  }\n}\nservice auth {\n  unix_listener \/var\/spool\/postfix\/private\/auth {\n    mode = 0666\n    user = postfix\n    group = postfix\n  }\n  unix_listener auth-userdb {\n   mode = 0600\n   user = vmail\n  }\n  user = dovecot\n}\nservice auth-worker {\n  user = vmail\n}\nservice dict {\n  unix_listener dict {\n  }\n}<\/code><\/pre>\n\n\n\n<p>vmail user is responsible for handling mails in teh server. Therefore, the user needs access to the location of the mails. Give vmail user the permissions it requires as below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chown \u2013R vmail:vmail \/home\/vmail<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-give-vmail-and-dovecot-users-permission-to-read-configuration-files\">Give vmail and dovecot users permission to read Configuration files.<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chown -R vmail:dovecot \/etc\/dovecot \nsudo chmod -R o-rwx \/etc\/dovecot <\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-configure-ssl-related-issues\">Configure SSL Related issues<\/h3>\n\n\n\n<p>In \/etc\/dovecot\/conf.d\/10-ssl.conf, there are SSL configurations you can make optionally. If you have no intections of using any SSL for Dovecot, open the file and set ssl as no<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <span class=\"has-inline-color has-pale-pink-color\">sudo vim \/etc\/dovecot\/conf.d\/10-ssl.conf<\/span>\nssl = no\n\n##If you want to use SSL here use ssl = required then add the files like:\n\nssl = required\nssl_cert = &lt;\/etc\/pki\/dovecot\/certs\/dovecot.pem\nssl_key = &lt;\/etc\/pki\/dovecot\/private\/dovecot.pem<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-6-install-and-configure-roundcube\">Step 6: Install and configure Roundcube<\/h2>\n\n\n\n<p>And now onto our web-based client to enable users to view their mails. You can download the latest stable release of Roundcube from their <a href=\"https:\/\/roundcube.net\/download\" target=\"_blank\" rel=\"noreferrer noopener\">official webpage<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>VER=\"$(curl -s https:\/\/api.github.com\/repos\/roundcube\/roundcubemail\/releases\/latest|grep tag_name|cut -d '\"' -f 4|sed 's\/v\/\/')\"\nwget https:\/\/github.com\/roundcube\/roundcubemail\/releases\/download\/$VER\/roundcubemail-$VER-complete.tar.gz<\/code><\/pre>\n\n\n\n<p>Uncompress the downloaded file and change the name of the resulting directory<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tar xvzf roundcubemail-$VER-complete.tar.gz\nmv roundcubemail-$VER roundcube<\/code><\/pre>\n\n\n\n<p>Now move the new directory to the document root of Apache, change its ownership to apache and restart Apache web server.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mv roundcube \/var\/www\/html\/\nsudo chown -R apache:apache \/var\/www\/html\/\nsudo systemctl restart httpd<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-load-roundcube-on-your-favorite-browser-to-complete-installation\">Load Roundcube on your favorite browser to complete installation<\/h3>\n\n\n\n<p>Open your browser and enter the following url<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/computingforgeeks.com\" target=\"_blank\" rel=\"noreferrer noopener\">http:\/\/IP\/FQDN\/roundcube\/installer<\/a><\/li>\n<\/ul>\n\n\n\n<p>In case the installer does not load, make sure your web-server is running and you have enabled port 80 on the firewall<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart httpd\nsudo firewall-cmd --permanent --add-port=80\/tcp\nsudo firewall-cmd --reload<\/code><\/pre>\n\n\n\n<p>Follow the screenshots below to complete the setting up of Roundcube<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized td-caption-align-https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-1-1024x635.png\" alt=\"\" class=\"wp-image-51107\" style=\"width:707px;height:438px\" width=\"707\" height=\"438\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-1-1024x635.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-1-300x186.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-1-768x476.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-1-696x432.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-1-1068x662.png 1068w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-1-677x420.png 677w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-1-356x220.png 356w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-1.png 1182w\" sizes=\"auto, (max-width: 707px) 100vw, 707px\" \/><\/figure>\n<\/div>\n\n\n<p>Make sure all the PHP checks are OK.<\/p>\n\n\n\n<p>Scroll down and click &#8220;<strong>Next<\/strong>&#8221; if everything is working fine.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large td-caption-align-https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-2-next.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"630\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-2-next-1024x630.png\" alt=\"\" class=\"wp-image-51109\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-2-next-1024x630.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-2-next-300x185.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-2-next-768x473.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-2-next-696x428.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-2-next-1068x657.png 1068w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-2-next-683x420.png 683w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-2-next-356x220.png 356w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-2-next.png 1183w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>On the next page, look for &#8220;<strong>Database Setup<\/strong>&#8221; and fill in the Roundcube Database details we created earlier. After that, you can add other configs on the page as you like then scroll to the bottom and click &#8220;<em>CREATE CONFIG<\/em>&#8220;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large td-caption-align-https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-3-database.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"656\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-3-database-1024x656.png\" alt=\"\" class=\"wp-image-51111\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-3-database-1024x656.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-3-database-300x192.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-3-database-768x492.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-3-database-696x446.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-3-database-1068x684.png 1068w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-3-database-656x420.png 656w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-3-database.png 1123w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large td-caption-align-https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-4-createconfig.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"637\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-4-createconfig-1024x637.png\" alt=\"\" class=\"wp-image-51114\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-4-createconfig-1024x637.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-4-createconfig-300x187.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-4-createconfig-768x478.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-4-createconfig-696x433.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-4-createconfig-1068x664.png 1068w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-4-createconfig-675x420.png 675w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-4-createconfig-356x220.png 356w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-4-createconfig.png 1175w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>On the &#8220;<strong>Create config<\/strong>&#8221; part look for &#8220;<strong>Create Config<\/strong>&#8221; and click on it which will lead to a page like below where you will be required to either download and transfer a config file or create it manually. Choose the one that you are comfortable with. Note that this file might automatically be saved to <em>\/var\/www\/html\/roundcube\/config\/. <\/em>If not, just proceed with the steps.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized td-caption-align-https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-5-savedownloadedconfig.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-5-savedownloadedconfig-1024x633.png\" alt=\"\" class=\"wp-image-51115\" style=\"width:1024px;height:633px\" width=\"1024\" height=\"633\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-5-savedownloadedconfig-1024x633.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-5-savedownloadedconfig-300x185.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-5-savedownloadedconfig-768x475.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-5-savedownloadedconfig-696x430.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-5-savedownloadedconfig-1068x660.png 1068w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-5-savedownloadedconfig-679x420.png 679w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-5-savedownloadedconfig-356x220.png 356w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-5-savedownloadedconfig.png 1184w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Initialize the Database<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"796\" height=\"647\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/06\/roundcube-after-continue.png\" alt=\"\" class=\"wp-image-58089\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/06\/roundcube-after-continue.png 796w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/06\/roundcube-after-continue-300x244.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/06\/roundcube-after-continue-768x624.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/06\/roundcube-after-continue-696x566.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/06\/roundcube-after-continue-517x420.png 517w\" sizes=\"auto, (max-width: 796px) 100vw, 796px\" \/><\/figure>\n\n\n\n<p>If you downloaded the file, transfer it to your server and copy it in the directory named in the instructions. Click &#8220;<em>CONTINUE<\/em>&#8221; after that.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo cp config.inc.php \/var\/www\/html\/roundcube\/config\/\nsudo chown apache:apache \/var\/www\/html\/roundcube\/config\/config.inc.php<\/code><\/pre>\n\n\n\n<p>Edit the config file to include smtp hosts, ports and method of logging in<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <span class=\"has-inline-color has-pale-pink-color\">sudo vim \/var\/www\/html\/roundcube\/config\/config.inc.php<\/span>\n$config&#91;'default_host'] = 'localhost';  ## If SSL is configured, use: $config&#91;'default_host'] = 'ssl\/\/mail.example.com';\n$config&#91;'support_url'] = '';\n$config&#91;'defautl_port'] = 143;\n$config&#91;'smtp_server'] = 'localhost';   ## If SSL is confgured, use: $config&#91;'smtp_server'] = 'tls\/\/mail.example.com'; \n$config&#91;'smtp_port'] = 587;\n$config&#91;'smtp_user'] = '%u';\n$config&#91;'smtp_pass'] = '%p';\n$config&#91;'smtp_auth_type'] = 'LOGIN';\n$config&#91;'debug_level'] = 1;\n$config&#91;'smtp_debug'] = true;\n$config&#91;'plugins'] = array('virtuser_query');                                                                    \n$config&#91;'virtuser_query'] = \"SELECT Email FROM postfix_accounts.accounts_table WHERE Email = '%u'\"; ## Enables Roundcube to use authentication for virtual users for outgoing mail<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large td-caption-align-https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-6-testconfig.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"587\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-6-testconfig-1024x587.png\" alt=\"\" class=\"wp-image-51118\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-6-testconfig-1024x587.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-6-testconfig-300x172.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-6-testconfig-768x441.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-6-testconfig-696x399.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-6-testconfig-1068x613.png 1068w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-6-testconfig-732x420.png 732w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-6-testconfig.png 1180w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Everything should be okay till this point. At the bottom of the page, you will see a banner that advises you to remove the whole installer directory after successfully setting up Roundcube.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large td-caption-align-https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-7-warning.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"494\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-7-warning-1024x494.png\" alt=\"\" class=\"wp-image-51123\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-7-warning-1024x494.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-7-warning-300x145.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-7-warning-768x370.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-7-warning-696x336.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-7-warning-1068x515.png 1068w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-7-warning-871x420.png 871w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-7-warning.png 1348w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-7-open-all-of-the-needed-ports-on-the-firewall\">Step 7: Open all of the needed ports on the firewall<\/h2>\n\n\n\n<p>In case your firewall is running, allow the following ports<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>HTTPS: 443<\/li>\n\n\n\n<li>SMTP: 25<\/li>\n\n\n\n<li>POP3: 110<\/li>\n\n\n\n<li>IMAP: 143<\/li>\n\n\n\n<li>SMTP Secure: 465<\/li>\n\n\n\n<li>MSA: 587<\/li>\n\n\n\n<li>IMAP Secure: 993<\/li>\n\n\n\n<li>POP3 Secure: 995<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo firewall-cmd --permanent --add-port={443,25,110,143,465,587,993,995}\/tcp\nsudo firewall-cmd --reload<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-8-testing-our-mail-server\">Step 8: Testing our Mail server<\/h2>\n\n\n\n<p>After everything is set-up and ready to go, it is time to test whether we are capable of sending and receiving emails.<\/p>\n\n\n\n<p>Load your browser and enter https:\/\/IP-or-FQDN\/roundcube<\/p>\n\n\n\n<p>Input any email account we configured earlier and its corresponding password.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large td-caption-align-https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-8-loggin.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"634\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-8-loggin-1024x634.png\" alt=\"\" class=\"wp-image-51122\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-8-loggin-1024x634.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-8-loggin-300x186.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-8-loggin-768x476.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-8-loggin-696x431.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-8-loggin-1068x662.png 1068w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-8-loggin-678x420.png 678w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-8-loggin-356x220.png 356w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-8-loggin.png 1180w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>After logging in, test if you can send and receive mails from your local domain and external as well if the requirements are met for that.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large td-caption-align-https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-9-inside.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"632\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-9-inside-1024x632.png\" alt=\"\" class=\"wp-image-51128\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-9-inside-1024x632.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-9-inside-300x185.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-9-inside-768x474.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-9-inside-696x430.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-9-inside-1068x660.png 1068w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-9-inside-680x420.png 680w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-9-inside-356x220.png 356w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-9-inside.png 1190w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large td-caption-align-https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-10-mailtest.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"527\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-10-mailtest-1024x527.png\" alt=\"\" class=\"wp-image-51129\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-10-mailtest-1024x527.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-10-mailtest-300x155.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-10-mailtest-768x396.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-10-mailtest-696x358.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-10-mailtest-1068x550.png 1068w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-10-mailtest-816x420.png 816w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2020\/04\/roundcube-10-mailtest.png 1365w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h1>\n\n\n\n<p>Setting up a simple mail server can be as quick as it has been in this guide. If it is sitting in the cloud with a valid FQDN and Mail Exchange records well configured, then you should be able to send and receive emails to whomever you wish. For now, we appreciate you for visiting. Other guides are listed below for your consideration.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/computingforgeeks.com\/install-iredmail-server-debian\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install and Setup iRedMail Mail Server on Debian 10 (Buster)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/computingforgeeks.com\/add-domain-user-iredmail\/\" target=\"_blank\" rel=\"noreferrer noopener\">How To Add Domains and User Accounts to iRedMail Mail Server<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/computingforgeeks.com\/iredmail-letsencrypt-ssl\/\" target=\"_blank\" rel=\"noreferrer noopener\">Secure iRedMail Server with Let\u2019s Encrypt SSL Certificate<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/computingforgeeks.com\/how-to-install-iredmail-mail-server-on-centos-7\/\" target=\"_blank\" rel=\"noreferrer noopener\">How To Install iRedMail Mail Server on CentOS 7<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In order to set up a full simple mail server, this guide takes advantage of Postfix as an SMTP server, Dovecot to provide POP\/IMAP functionality, and RoundCube as a webmail program or client so that users can check and receive email from their favorite web browsers. In this article we&#8217;re going to perform an installation &#8230; <a title=\"Setup Mail Server on CentOS 8 With Postfix, Dovecot, MySQL and RoundCube\" class=\"read-more\" href=\"https:\/\/computingforgeeks.com\/how-to-setup-mail-server-on-centos\/\" aria-label=\"Read more about Setup Mail Server on CentOS 8 With Postfix, Dovecot, MySQL and RoundCube\">Read more<\/a><\/p>\n","protected":false},"author":7,"featured_media":51122,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[299,17,328,5,50,139],"tags":[141,323,173,21691],"class_list":["post-51100","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to","category-centos","category-email","category-featured","category-linux-tutorials","category-postfix","tag-dovecot","tag-mysql","tag-postfix","tag-roundcube"],"_links":{"self":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/51100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/comments?post=51100"}],"version-history":[{"count":0,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/51100\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media\/51122"}],"wp:attachment":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media?parent=51100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/categories?post=51100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/tags?post=51100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}