The email did not need too much presentation as we all sent and received one. There are companies that provide us with the Email service and that is more than enough for the vast majority of users, but there is the possibility of having one on our own server.
Companies are turning to be technologically independent from other large companies and to be the ones that manipulate their data, including the most sensitive ones. However, it is important to bear in mind that depending on the infrastructure and personnel resources, there may be more disadvantages than benefits to taking this option.
In this article we are going to configure a personal mail server on our server with Ubuntu 18.04
Let’s get to work
1.-Upgrading the operating system
This is done to provide the latest software updates and security patches to improve server performance. First we log in as root user:
As root user, we write:
apt update && apt -y upgrade
Postfix is a free software/open source mail server, a software program for routing and sending email. It is simple and versatile. We will use it in this tutorial. Run this command on terminal for install it.
apt install postfix
As soon as you finish the download and installation, we will skip this screen.
We chose Internet Site and press enter.
We now place our domain
And finally the installation is complete
Once the installation is done we must restart the postfix service.
In case of modifying the values we have placed, we can reconfigure the package with the command:
3.-Dovecot’s turn now
Dovecot is an open source IMAP and POP3 server for GNU/Linux / UNIX-like systems, written with security in mind. To install it:
And then we start and enable the service:
systemctl start dovecot
systemctl enable dovecot
SquirrelMail is a webmail application created by Nathan and Luke Ehresman and written in PHP. It can be installed on most web servers as long as it supports PHP and the web server has access to an IMAP server and another SMTP server. To download:
Then we decompressed
We proceed to move it inside the web server and change its owner and permissions.
mv squirrelmail-webmail-1.4.22 /var/www/html/
chown -R www-data:www-data /var/www/html/squirrelmail-webmail-1.4.22/
chmod 755 -R /var/www/html/squirrelmail-webmail-1.4.22/
It’s a good idea to change the name:
mv squirrelmail-webmail-1.4.22 /var/www/html/squirrelmail
Before using Squirrelmail ask us to configure them. We can do it thanks to the configuration script that comes inside the conf folder.
Enter “2” to access the server options
And now “1” to define the domain.
we return by pressing “r”. Enter the general options by typing “4” Then in option “11” change “false” to “true” by typing “y”.
We leave the script and we have to go to the web browser to verify that the installation has been successful.
5.- creating users for the mail server
To log in from the web interface, we must create a user name and password.
then we create a folder inside the apache location and make it its default folder.
usermod -m -d /var/www/html/user1 user1
then change the owner of the folder for the new user
chown -R user1:user1 /var/www/html/user1
6.- Logging in to SquirrelMail
Finally we access the web interface and log in:
And finally we see the interface working.
Note: If at the moment of logging in with the username and password, you give us an error. It’s most likely an error in permissions.