
To do so you will need to run the command: #yum -y install php php-fpm php-common php-pdo php-mbstring php-imap php-cli php-mysql nginxĮdit the /etc/php-fpm.d/listen = /var/run/php-fpm.sock Now we can install all the needed packages. Now we need to add the epel repo so that we can install the full list of needed packages. For that create a new file /etc//nginx.repo with the following value in it.

First you need to add a new repo for nginx cause we want to use the latest version available. Now it's time to install nginx and the postfixadmin. These queries does not write to the database therefore this user will only have select right granted. The other user is postfix, which will be used by the postfix and dovecot to query the users from the database. First the postfixadmin is the user which would be used by the webgui called postfixadmin which need write privileges into the database because you will be adding the domains, users and aliases which will be holded by this installation via it. We have created two users with different privileges. MariaDB> grant select on mail.* to identified by 'someotherpass' MariaDB> grant all privileges on mail.* to identified by 'somepass'

Now it's time to create our database and the proper users with the needed privileges: #mysql -u root Make sure that your database will start upon startup: #systemctl enable rvice To start the database please run the following command: #systemctl start rvice Next we start the mysql database and create a database for our installation. o smtpd_client_restrictions=permit_sasl_authenticated, reject o smtpd_client_restrictions=permit_sasl_authenticated,reject To configure the smtps and submission for local delivery change the following in /etc/postfix/master.cf submission inet n - n - smtpd etc/postfix/sql/mysql_virtual_domains_maps.cf user = postfixĪdditional_conditions = and backupmx = '0' and active = '1' etc/postfix/sql/mysql_virtual_mailbox_maps.cf user = postfix #additional_conditions = and active = '1' etc/postfix/sql/mysql_virtual_mailbox_limit_maps.cf user = postfix etc/postfix/sql/mysql_virtual_alias_maps.cf user = postfix etc/postfix/sql/mysql_relay_domains_maps.cf user = postfixĪdditional_conditions = and backupmx = '1' You need to add create the following files: Smptd_tls_session_cache_database=btree:/var/spool/postfix/smtpd_tls_cache Virtual_mailbox_limit_maps=mysql:/etc/postfix/sql/mysql_virtual_mailbox_limit_maps.cf Virtual_maildir_limit_message=Sorry, Your maildir has overdrawn your diskspace quota, please free some space of your mailbox and try again. Virtual_mailbox_maps = mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf Virtual_mailbox_domains = mysql:/etc/postfix/sql/mysql_virtual_domains_maps.cf Virtual_alias_maps = mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf Unknown_local_recipient_reject_code = 550 Smtpd_tls_key_file = /etc/pki/tls/private/ Smtpd_tls_cert_file = /etc/pki/tls/certs/ Smtpd_sasl_security_options = noanonymous Smtpd_recipient_restrictions = permit_sasl_authenticated,Ĭheck_policy_service unix:postgrey/socket,

Smtpd_helo_restrictions = permit_mynetworks, Sendmail_path = /usr/sbin/sendmail.postfix Sample_directory = /usr/share/doc/postfix-2.10.1/samples Readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES Newaliases_path = /usr/bin/newaliases.postfix Mydestination = $myhostname, localhost.$mydomain, localhost When that's done we need to edit the /etc/postfix/main.cf to match your needed configuration: alias_database = hash:/etc/aliasesĭebugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin$daemon_directory/$process_name $process_id & sleep 5 Will achieve that using yum: #yum -y install postfix dovecot dovecot-mysql mariadb-server We will make sure that we have all the related packages installed. We will be using in this example a mysql backend. After we are able to successfully send and retrieve e-mails we will securing the server with postgrey, spamassassin and clamav antivirus. In this post we will install a mail server using virtual users with authentication using dovecot and ssl.
