Members

Just follow this step by step guide, and you shouldn’t have any problems setting up the configuration!

 

Install Postfix Email Server

 

Now it is time to install Postfix. Postfix is an email server written in C. Its main feature is the speed of execution and open source nature. Install it with the following command:

 

$ sudo apt install postfix

 

During installation, we will be asked to configure the package. On the first screen, choose the option Internet Site.

 

Then, we have to enter the name of the server. In this case test.com.

 

Postfix is very flexible and allows extensive configuration, but for this tutorial we’ll fix with the default configuration.

 

Add User

 

Then, we have to add our user to the group mail:

 

$ sudo usermod -aG mail $(whoami)

 

This must be done because in Ubuntu 18.04 only users who are in the mail group can make use of this utility.

 

After that, we have to create the users and add them to the mail group so they can send and receive mail. I’ll add Gabriel:

 

$ sudo useradd -m -G mail -s /bin/bash/ gabriel

 

Then, we need to set a password to the newly created user:

 

$ sudo passwd gabriel

 

Test the Ubuntu Mail Server

 

Now to prove what we just did. We will send and receive an email from the terminal. To do this, we will install the mailutils package:

 

$ sudo apt install mailutils

Next, we send an email to the other email account user named gabriel. Type in the subject and the message. After that, press CTRL+D to finish. To start writing an email enter the following command:

 

mail [email protected]

 

Now we can log into another user and check the mail utility.

 

There, after running the mail command, we will see the email we just sent to the other test user. To access the email just write the number of the mail, in this case, 1.

 

To test outbound emails from this user, just try another email address:

 

mail [email protected]

 

That’s it! You’re sending emails from your very own email server on Ubuntu 18.04! Congratulations.

 

Conclusions

 

An email server is easy to set up but might be a bit complex to manage. In Linux, it is recommended to do it for its security and resource management.

 

On the other hand, in a company, it can be very useful to have a configured and functional email server.

 

There are many ways to improve and maintain an email server. It is a process that takes time and is constantly evolving. So we recommend that you keep going deeper into the subject! Good luck and happy mailing!

 

You can also follow Install Mail Server On Ubuntu - Complete Setup Guide to install a professional email server.

Views: 1

Comment

You need to be a member of On Feet Nation to add comments!

Join On Feet Nation

© 2024   Created by PH the vintage.   Powered by

Badges  |  Report an Issue  |  Terms of Service