Virtualmin Email Issue - Webmin Postfix - Outgoing SMTP Configuration - SMTP Port 25 Blocked

Todays internet world, most ISP's block outgoing email smtp port 25 for security issue !

Now I'm here to solve Virtualmin email issue.

Firstly, configure SSL certs for your server services including Webmin, Postfix, Usermin.

Then configure authentication:

 

Virtualmin Postfix




1) Webmin > Servers > Postfix Mail Server > SMTP Authentication And Encryption

Set, Require SASL SMTP authentication? = Yes
Set, Enable TLS encryption? = Always
Set, Use SASL SMTP authentication? = No

2) Webmin > Servers > Postfix Mail Server > Edit Config Files

Here you select the /etc/postfix/master.cf file.

Ensure the two lines for submission and smtps is not commented:

submission    inet    n    -    y    -    -    smtpd -o smtpd_sasl_auth_enable=yes -o smtpd_tls_security_level=may

smtps    inet    n    -    y    -    -    smtpd -o smtpd_sasl_auth_enable=yes -o smtpd_tls_security_level=may -o smtpd_tls_wrappermode=yes

Additionally, if you're still unable to send outgoing email, and want postfix to listen on a custom port then find and see this line:

smtp    inet    n    -    y    -    -    smtpd -o smtpd_sasl_auth_enable=yes -o smtpd_tls_security_level=may

And add another line underneath that, except change the "smtp" to custom 2525 port you wish to use:

2525    inet    n    -    y    -    -    smtpd -o smtpd_sasl_auth_enable=yes -o smtpd_tls_security_level=may

Save the file and restart postfix.

This custom 2525 port will only work if your system's mail server and mail client is manually configured to deliver mail via your custom port.

3) Firewall issue check;

Web hosting company like "1&1 IONOS" uses external firewall. Make sure the necessary firewall ports are open. The necessary ports for Virtualmin is listed below:

21, 22, 25, 53, 80, 443, 465, 587, 993, 995, 2525, 10000, 20000

4) Config Server Firewall (CSF) SMTP Restrictions;

You may use the great CSF firewall to secure your system. I recommend to use CSF for server security.

Check your firewall ports opened in CSF, and also check the SMTP_BLOCK section.

There are two well-known smtp server is "Exim" and "Postfix".
cPanel/WHM uses the Exim smtp server, but the Virtualmin uses the Postfix smtp server.

Here at CSF SMTP BLOCK section, the Exim is allowed by default, but Postfix is not.

So, allow postfix to the mailer group;

SMTP_ALLOWGROUP = mail,mailman,postfix

Save and restart CSF.

That's it, restart your server, and enjoy !

Post a Comment