Bash:
Step-by-Step Guide for Installing an Email Server4
Update your system:
Open a terminal window
Run the command sudo apt update
Run the command sudo apt upgrade
Install Postfix:
Run the command sudo apt install postfix
Choose Internet Site when prompted
Enter the domain name of your server when prompted
Install Dovecot:
Run the command sudo apt install dovecot-imapd
Choose No when prompted
Configure Dovecot:
Open the file /etc/dovecot/dovecot.conf in a text editor
Find the line that reads protocols = imap and change it to protocols = imap pop3
Find the line that reads disable_plaintext_auth = yes and change it to disable_plaintext_auth = no
Save and close the file
Configure Postfix:
Open the file /etc/postfix/main.cf in a text editor
Find the line that reads inet_interfaces = all and change it to inet_interfaces = loopback-only
Find the line that reads mydestination = $myhostname and change it to mydestination = localhost
Save and close the file
Restart the services:
Run the command sudo service postfix restart
Run the command sudo service dovecot restart
That's it! You now have a working email server on Ubuntu 18.04. 🎉