habibzain Just husband, father and enthusiastic men about System Administration. Love to write short article about it. Perhaps can help and be useful for others.

Alma Linux 8 – Postfix SMTP Server

1 min read

Alma Linux 8 – Postfix SMTP Server

Today, i will write about postfix smtp server in Alma linux 8. Alma linux is the successor of the discontinued centos. Alma linux claim forever-free enterprise Linux distribution, focused on long-term stability, providing a robust production-grade platform. And also 1:1 binary compatible with RHEL® and pre-Stream CentOS.

Installing Postfix

On your Alma linux server, run the following commands.

yum install postfix -y

Once it’s installed, start Postfix SMTP server.

sudo systemctl start postfix

And enable auto-start at boot time.

sudo systemctl enable postfix

Now you can check its status with:

systemctl status postfix

Check Postfix version with this command:

root@server# postconf mail_version

mail_version = 3.5.8

Alma Linux 8 ships with Postfix v3.5.8.

Configuring Alma Linux 8 postfix

Listening on the public IP address

[root@server]# postconf inet_interfaces

inet_interfaces = localhost

We need to run the following command to configure Postfix to listen on the public IP address so it will be able to receive emails from other SMTP servers. The -e option enables postconf to edit the Postfix main configuration file.

sudo postconf -e "inet_interfaces = all"
postconf myhostname

Postfix uses this hostname to identify itself when communicating with other SMTP server.

sudo postconf -e "myhostname = mail.yourdomain.com"

Setting $myorigin Parameter

The $myorigin parameter specifies the default domain name that will be appended to sender and recipient addresses that have no @domain part. The default is to use the value of $myhostname, as can be seen with:

postconf myorigin

Output:

myorigin = $myhostname

You need to change its value to yourdomain.com, so a sender on your mail server will have @yourdomain.com address.

sudo postconf -e "myorigin = yourdomain.com"

Setting $mydestination Parameter

The $mydestination parameter specifies the list of domains that your server considers itself the final destination for. You can display the current value of $mydestination with:

postconf mydestination

Output

mydestination = $myhostname, localhost.$mydomain, localhost

Default postfix SMTP server to receive emails coming for [email protected][email protected] and someone@localhost, but it won’t allow you Postfix SMTP server to receive emails coming for [email protected]. In order to achieve that, add yourdomain.com to the list of domains.

sudo postconf -e "mydestination = yourdomain.com, \$myhostname, localhost.\$mydomain, localhost"

Restarting Postfix

Finally, we need to restart Postfix for the changes to take effect.

sudo systemctl restart postfix

Ok, thats it. Please feel free for comment out. Maybe usefull.

See also  PFDel Script Delete Mail Queue Postfix and Zimbra

Credit Article: www.linuxbabe.com


Let's Buy Me Coffee.

Buy Me a Coffee at ko-fi.com

https://saweria.co/habibzain
https://ko-fi.com/habibzain
habibzain Just husband, father and enthusiastic men about System Administration. Love to write short article about it. Perhaps can help and be useful for others.

Centos Failed Update Kernel

Today I did a kernel update on my server with Centos 7 OS. At the end of the update process, I found a kernel...
habibzain
1 min read

Easy Fix Missing mirrorlist http://mirrorlist.centos.org on CentOS 7

When running yum update or command that utilize the yum system, errors similar to the following are produced: If you’re encountering issues with the...
habibzain
1 min read

Easy Create Laravel Project with Composer

Requirement Laravel, a popular PHP framework, is renowned for its elegant syntax and robust features, making it a top choice for web developers. One...
habibzain
1 min read

Leave a Reply

Your email address will not be published. Required fields are marked *

Never miss good article from us, get weekly updates in your inbox