• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

How can I block Port 25 for outgoing mail?

P

plaine

Guest
Hello,

I'd like to block outgoing traffic on port 25 on our Linux server running Plesk 8.6. I'd still like mail to come in, I just want to require users using our outgoing smtp to use port 587 instead. I tried to create a new rule in the firewall to deny outgoing traffic on port 25, but it didn't work, so I'm guessing I need to something more complex than that. Any help would be appreciated. Thanks,

chris
 
You could set Server > Mail > Relaying to closed, but then your clients also can't send out mail by using the submission port (587). You also can't firewall connections to port 25, because you need that open to be able to receive e-mail. I don't think that what you want is possible through Plesk's interface. You'll either need to tell your clients to use port 587 or you'll have to manually edit the xinetd configurations or something.
 
You can also use some firewall like apf and can block all outgoing traffic through port 25.
 
I don't think that would help. I don't think port 25 outgoing is used to connect to remote SMTP servers (usually some random high port) and if it would then that would probably also affect people using the submission port, right?
 
You could disable SMTP authentication for the instance of qmail running on port 25 (.... I think). That way, it would still accept mail for your domain, but users wouldn't be able to log in to relay mail out
 
Hello,

I'd like to block outgoing traffic on port 25 on our Linux server running Plesk 8.6. I'd still like mail to come in, I just want to require users using our outgoing smtp to use port 587 instead. I tried to create a new rule in the firewall to deny outgoing traffic on port 25, but it didn't work, so I'm guessing I need to something more complex than that. Any help would be appreciated. Thanks,

chris

Hello

To disable the outgoing mails in server, you can just comment the entries in /etc/resolv.conf. you can check that the test mail has failed by referring the logs under /var/log/mail
 
To disable the outgoing mails in server, you can just comment the entries in /etc/resolv.conf.

Woah, doing that effectively kills your server's ability to resolve hostnames. The impact of doing that will probably kill a lot more than you like... (And it won't block mail sent to IP addresses instead of hostname.)
 
Back
Top