It is useful to have a mail server on your system. Setting up a mail server on a Linux system is a useful tool that is used by many users, You can host your email account, also many services send their reports and messages to your email. You can do this with Postfix which is a post-transfer agent for Linux. So follow the instructions here to configure a Mail Server on Linux VPS.
Now, you can learn how to do configure the mail server step-by-step on Linux.
Here, you can find some requirements before setting up the mail server:
_ Operating System: Any Linux distro
_ Software: Postfix and Mailx
_ Root access or access via sudo command
As mentioned here, to start the mail server, you need to install the Postfix and Mailx server, which are sometimes installed by default. Now, go through the following instructions carefully.
Step1)
Use your system package manager to install Postfix and Mailx by running the commands below:
1- command to use for Ubuntu, Debian, and Linux mint:
sudo apt install postfix mailutils
2- command to use for Fedora, CentOS, AlmaLinux, and RedHat:
sudo dnf install postfix mailx
3- Command to use for Arch Linux and Manjaro:
sudo pacman -S postfix mailx
Step2)
During the installation process, you must select the type of email to configure. In this case, you will have two options: ‘Internet site‘ and ‘Local only‘
If your domain name is fully qualified, you can choose an internet site, otherwise choose the Local mode:
Step3)
Here as you see in this image, you can set your fully qualified domain name or local domain name:
Step4)
At this point, you can start and enable the postfix server to start automatically on the next boot:
sudo systemctl start postfix
sudo systemctl enable postfix
Step 5)
Here, you can add your user and any other users who need to use mail service to the mail group:
sudo usermod -aG mail $(whoami)
Now, you can test your mail server by sending an email to a root user account:
$ mail root
Cc:
Subject: Testing email
This is an email from NeuronVM.com
Then, press Ctrl+D to send an email, then you can return to your terminal prompt.
In this section, you can use the command below to check the root inbox and see that you have received the test email:
$ sudo mail "/var/mail/root": 1 message 1 new >N 1 NeuronVMNeuronVM.com Sun Mar 12 00:54 15/489 Testing email ?
In this example, N means new email and 1 shows the ID of the massage. As you see, [email protected] (username@hostname) is the sender. Also delivery time and the subject. If you want to check your local mail, you can type massage ID and hit enter to confirm.
This article thought you how to configure a mail server on a Linux system. This server is important and useful cause, it allows you to control your email service privately and receive system alerts from various services.
It is an open-source mail transfer agent which routes and delivers mail.
How useful was this post?
Click on a star to rate it!
Average rating 5 / 5. Vote count: 1
No votes so far! Be the first to rate this post.
We decided to review MikroTik in this article and install it on VirtualBox. MikroTik is based on Lin...
In this tutorial, you will learn How to LVM Partitioning on a Dedicated Server. LVM stands for Logic...
What is your opinion about this Blog?