Install Postfix on CentOS 7
To install Postfix on CentOS 7, follow these steps:
Open a terminal or login to your server via SSH as a root user.
Update your system packages by running the following command:
yum update
Install Postfix using the following command:
yum install postfix
Start the Postfix service using the following command:
systemctl start postfix
To make sure Postfix starts automatically after a server reboot, run the following command:
systemctl enable postfix
By default, Postfix listens on port 25 for incoming mail. If you’re running a firewall on your server, make sure to open port 25 by running the following command:
firewall-cmd --permanent --add-port=25/tcp
firewall-cmd --reload
That’s it! Postfix should now be installed and running on your CentOS 7.9 server. You can test it by sending an email to a valid email address from your server’s command line using the mail command, for example:
echo "This is a test email" | mail -s "Test Email" recipient@example.com
Installing Postfix on CentOS 8, Almalinux, Rocky
Open a terminal or login to your server via SSH as a root user.
Update your system packages by running the following command:
dnf update
Install Postfix using the following command:
dnf install postfix
Start the Postfix service using the following command:
systemctl start postfix
To make sure Postfix starts automatically after a server reboot, run the following command:
systemctl enable postfix
By default, Postfix listens on port 25 for incoming mail. If you’re running a firewall on your server, make sure to open port 25 by running the following command:
firewall-cmd --permanent --add-port=25/tcp
firewall-cmd --reload
You can test it by sending an email to a valid email address from your server’s command line using the mail command, for example:
sudo dnf install mailx
echo "This is a test email" | mail -s "Test Email" recipient@example.com
Installing Postfix on Ubuntu and Debian
Open a terminal or login to your server via SSH as a root user.
Update your system packages by running the following command:
apt-get update
Install Postfix using the following command:
apt-get install postfix
Start the Postfix service using the following command:
systemctl start postfix
To make sure Postfix starts automatically after a server reboot, run the following command:
systemctl enable postfix
By default, Postfix listens on port 25 for incoming mail. If you’re running a firewall on your server, make sure to open port 25 by running the following command:
ufw allow 25/tcp
sudo apt-get install mailutils
echo "This is a test email" | mail -s "Test Email" recipient@example.com
0 Comments