Use remote mail server to send mail from PHP scripts


Feb 4, 2016
cPanel Access Level
Root Administrator
By default WHM restricts outbound requests on port 25 and 587 to root and exim. When other users try and make a connection to a remote IP on these ports, that connection is routed back to localhost. This is to prevent unprivileged users pumping spam out of the server.

Is there any way I can keep this protection, but allow access to a remote server? The remote server requires authentication and is on a fixed IP.


Staff member
Apr 11, 2011
Hello @dcas,

It's not possible to configure WHM >> SMTP Restrictions on a per-user or per-IP basis. However, you can disable this option and use a third-party application such as CSF to implement the same type of protection on a per-user basis. There's a thread on this topic at:

SMTP Connection Refused for any Account Except root

Additionally, I encourage you to vote and add feedback to the following feature request if you'd like to see support for this type of functionality added to cPanel & WHM:

SMTP Disabled Restrictions per Account

Note the feature request is for a per-user configuration, but you can add a comment to voice support for a per-IP configuration as well.

Thank you.