Professional Documents
Culture Documents
Exim
Exim
Exim
In the following tutorial, we will teach you how to install and set up a mailserver using
Exim and Dovecot on a CentOS 7 VPS.
We will use a CentOS based VPS host plan for this tutorial; it will be pre-installed
with minimal CentOS 7 OS.
What is Exim?
Exim is a mail transfer agent (MTA) which is commonly used on Unix-like operating
systems. Exim is a free software, which is distributed under the terms of the GNU
(General Public License), and it’s trying to be a general and flexible mailer with
extensive facilities for verifying any incoming e-mail.
What is Dovecot?
Dovecot is an open-source IMAP and POP3 email server for Linux/UNIX-like
systems. It was written with security as its top priority. Dovecot is an amazing choice
for both small and large installations.
## screen -U -S exim-dovecot
After you are in the screen session, update your CentOS 7 VPS with yum as follows:
## yum update
Copy
## yum repolist
Copy
## mkdir /root/SSL/mail.mydomain.com -p
## cd /root/SSL/mail.mydomain.com
## openssl req -nodes -x509 -newkey rsa:2048 -keyout
mail.mydomain.com.key -out mail.mydomain.com.crt -days 365
Copy
With the command below, we will move the SSL certificate and key to /etc/ssl
directory:
Now, we will open the file /etc/exim/exim.conf using your favorite editor, then
configure exim as follows:
## cp /etc/exim/exim.conf{,.orig}
## vim /etc/exim/exim.conf
primary_hostname = mail.mydomain.com
tls_advertise_hosts = *
tls_certificate = /etc/ssl/mail.mydomain.com.crt
tls_privatekey = /etc/ssl/mail.mydomain.com.key
auth_advertise_hosts = *
local_delivery:
driver = appendfile
directory = $home/Maildir
maildir_format
maildir_use_size_file
delivery_date_add
envelope_to_add
return_path_add
Scroll down to the authenticators section and append the next lines:
dovecot_login:
driver = dovecot
public_name = LOGIN
server_socket = /var/run/dovecot/auth-client
server_set_id = $auth1
dovecot_plain:
driver = dovecot
public_name = PLAIN
server_socket = /var/run/dovecot/auth-client
server_set_id = $auth1
Initiate the EXIM MTA then append it to the system’s startup using systemctl
ssl = yes
ssl_cert = </etc/ssl/mail.mydomain.com.crt
ssl_key = </etc/ssl/mail.mydomain.com.key
## vim /etc/dovecot/conf.d/10-auth.conf
disable_plaintext_auth = no
## vim /etc/dovecot/conf.d/10-mail.conf
mail_location = maildir:~/Maildir
Now we’ll set up Dovecot so it grants Exim the ability to use its authentication system
in
/etc/dovecot/conf.d/10-master.conf
## vim /etc/dovecot/conf.d/10-master.conf
service auth {
...
unix_listener auth-client {
mode = 0660
user = exim
Start up Dovecot and append it to the system’s start-up using the following:
## useradd -m test
## passwd test
Copy