Easy Method To Set Up A Personal Mailbox

In our previous articles we have installed LAMP stack at our server, configured FTP and DNS records for our site. Now, generally, you probably want to add admin mailboxes for them. It's pretty standard, and a mailbox that looks professional is always welcome. Mail server software actually contain a SMTP server (exim) which receives and sends mail to remote servers, and POP/IMAP server (dovecot) which allow users to retrieve stored mail from their mailboxes. You can also, technically, host your domain at Google and use Gmail with your domain mailboxes but it’s not free, and there are restrictions that come with that.

Installing exim

We'll run the following commands to install the latest EPEL repository and exim package, as well as disable postfix:

# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
# yum install exim –y
# service postfix stop
# chkconfig postfix off 

Now we will run these commands to change the default MTA to exim,
select exim in a menu, add a line to exim config file, and launch it:

# alternatives --config mta
# chkconfig exim on
# echo “primary_hostname = mail.iloveserversuit.com” >> /etc/exim/exim.conf

Edit ‘/etc/exim/exim.conf’ transport section like this:

local_delivery:

driver = appendfile
directory = $home/Maildir
maildir_format
maildir_use_size_file
delivery_date_add
envelope_to_add
return_path_add

And add following lines to the authenticators section to allow interaction with Dovecot

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

Done! Now let’s start exim:

# service exim start

Then we need to create a user ‘admin’ for our mailbox:

# adduser admin –s /sbin/nologin
# passwd admin

If you’re already configured DNS records as we discussed before, you can now send mail to admin@iloveserversuit.com! However, it will only be stored locally. To retrieve it you’ll need a ‘dovecot’ package.

Installing dovecot

# yum install dovecot
# chkconfig dovecot on

Edit file ‘/etc/dovecot/conf.d/10-auth.conf’ to allow plain-text auth:

disable_plaintext_auth = no
auth_mechanisms = plain login

Edit file ‘/etc/dovecot/conf.d/10-mail.conf’ to set mailbox storage:

mail_location = maildir:~/Maildir

And edit '/etc/dovecot/conf.d/10-master.conf’ to allow Exim using Dovecot authentication:

service auth {
    unix_listener auth-client {
        mode = 0660
        user = exim
    }
}

That’s all!
You email client is all set up, and you got an admin account to use. You can follow these steps to add more accounts if you need them. Fundamentally, this is how you build a mail server.

But what's cool about ServerSuit, is that you don't need to go through all that. We have recently added Mail Server support to our dashboard. Once you sign in and have at least one server added, you can install a fully preconfigured "Easy Mail Server" from the software library! I think it's important to know how to set it up yourself, which is what the tutorial is for. But nothing beats not having to do it.

You can sign up for a free account right now, and we'll let you explore our system free for 30 days! Give it a try!

April 05 2016

Add or review comments

Please leave your comment

Existing comments

Comments 0


Get notified about new publications and product updates.
Please note we do not share information to anyone.