Configure Dovecot to receive email with in your server.
Install dovecot with `apt-get install dovecot-imapd`
Dovecot version and config file
# 2.2.9: `/etc/dovecot/dovecot.conf`
Linux Server (it will work with new versions with little or no adjustment)
# OS: Linux 3.13.0-116-generic x86_64 Ubuntu 14.04.5 LTS
Edit your `/etc/dovecot/dovecot.conf` file.
auth_debug = yes
auth_debug_passwords = yes
disable_plaintext_auth = no
listen = *
mail_location = mbox:~/mail:INBOX=/var/mail/%u
namespace inbox {
inbox = yes
location =
mailbox Drafts {
special_use = \Drafts
}
mailbox Junk {
special_use = \Junk
}
mailbox Sent {
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox Trash {
special_use = \Trash
}
prefix =
}
passdb {
#driver = pam
}
passdb {
args = scheme=SHA512-CRYPT username_format=%u /etc/dovecot/users
driver = passwd-file
}
protocols = imap
service auth-worker {
group = shadow
}
ssl_cert =
ssl_key = userdb {
driver = passwd
}
protocol imap {
imap_client_workarounds = tb-extra-mailbox-sep
}
This file `/etc/dovecot/users` was created, see below:
To generate the password, execute `doveadm`
doveadm pw -s SHA512-CRYPT (the password will be prompted)
The command returns something like this, put this string inside `/etc/dovecot/users` and save.
user:{SHA512-CRYPT}$6$2TEJo6hStd3.NgQs$5nIeyUn/1bA4.dptvfsQ0wtU1XtnSqGRSkmn5bV5OcJRRAurmYxdaUcgOpEpQSLbHmKwhgRa9ik18TN6ckVuH0:1000:1000::/home/user
I will not cover SMTP here, but you can install `Exim4` (MTA) and combine the use with `Dovecot` (MDA) if you like, there are many options out there.
That's All! Enjoy your new mailserver.