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:
            sudo -i
As root user, we write:
          apt update && apt -y upgrade
2.-Installing Postfix
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.
            systemctl restart
In case of modifying the values we have placed, we can reconfigure the package with the command:
dpkg-reconfigure postfix
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
Next:
               systemctl enable dovecot
4.-Installing SquirrelMail
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:
           wget https://sourceforge.net/projects/squirrelmail/files/stable/1.4.22/squirrelmail-webmail-1.4.22.zip
Then we decompressed
          unzip squirrelmail-webmail-1.4.22.zip
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/
and finally:
          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.
          perl /var/www/html/squirrelmail/config/conf.pl
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.
            http://IP_SERVER/squirrelmal
5.- creating users for the mail server
To log in from the web interface, we must create a user name and password.
          useradd user1
          passwd user1
then we create a folder inside the apache location and make it its default folder.
           mkdir /var/www/html/user1
           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.
Please help. I am trying to set this on ubuntu 18.04 live server. Here i dont have any browser. How do i test the server?
use browser in host different have conected with it
When I try to do step 11, it says “mv: cannot move ‘squirrelmail-webmail-1.4.22’ to ‘/var/www/html/’: No such file or directory” HELP
-I’ve done all of the previous steps successfully, why is this one NOT working?
you need install apache
Error opening ../data/default_pref
Could not create initial preference file!
/var/local/squirrelmail/data/ should be writable by user www-data
Please contact your system administrator and report this error.
You should be copy squirrelmai to /var/local/ , and try again !!!
I have the same message. What can I do? helpp
sudo chmod 777 /var/local/squirrelmail/data/
When I got this message I just created the dir /squirrelmail/data/ inside of /var/local/ and chown’ed it to www-data:www-data and it started working for me
this helped me thanks for sharing
I get this at step 5:
root@mail:/var/www/html/squirrelmail/config# usermod -m -d /var/www/html/user3 user3
usermod: directory /var/www/html/user3 exists
I get a blank white page after logging in
I have setted up everything. Every thing is working correctly but I can only receive email but cannot sent any email from it
I have checked the file and it’s there so I don’t know why i’m getting this error message “ERROR: Config file ‘ . ‘”config/config.php” not found. You need to ‘ . ‘configure SquirrelMail before you can use it.
‘; exit; } // If we are, go ahead to the login page. header(‘Location: src/login.php’); ?>”
http://IP_SERVER/squirrelmal not open with browser
http://192.168.0.149/squirrelmal
http://192.168.0.149/squirrelmail