If your service provider has blocked port 25, you may need to change it to 587 from your mail server. Port 25 causes security vulnerabilities because it does not perform any authentication process during mail sending. Therefore, service providers allow sending mail by authenticating over port 587. If you are using Postfix as the mail server, you can fix the problem by following the steps below.
Changing the default SMTP port for Postfix
Step 1: Open master.cf via nano
Open the Postfix configuration file which is located under /etc/postfix/master.cf.
Step 2: Activate SMTP
Activate SMTP by removing the ” # ” sign in front of smtpd from the configuration file and exit the file by saving it.
Step 3: Restart Postfix
systemctl restart postfix
After restarting the postfix, you have successfully changed the port on Postfix with 587; your mail server is now secure.