Cant send mails with PHPMailer

telmark

Registered
Jul 31, 2017
2
0
1
uruguay
cPanel Access Level
Root Administrator
I can not send mails (I want to send them directly from Gmail, not with the mail () function), I'm trying the PHPMailer library and when I run it from a URL It does not work, it disconnects me from the server in the middle of the connection. If I do from SSH, with the root user, all right, send the mails correctly.
The option: whm > security center > SMTP Restrictions is Disable.
Now if I run from the browser that same, it does not work:
In: /var/log/apache2/error_log does not register errors.

I want to use the port 465, 587 and 25.

I see if is a rule in iptables and i found that:
[[email protected] tienda]# iptables -S|grep "465"
-A INPUT ! -i lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 465 -j ACCEPT
-A SMTPOUTPUT -o lo -p tcp -m multiport --dports 25,465,587,26 -j ACCEPT
-A SMTPOUTPUT -p tcp -m multiport --dports 25,465,587,26 -m owner --gid-owner 991 -j ACCEPT
-A SMTPOUTPUT -p tcp -m multiport --dports 25,465,587,26 -m owner --gid-owner 12 -j ACCEPT
-A SMTPOUTPUT -p tcp -m multiport --dports 25,465,587,26 -m owner --uid-owner 202 -j ACCEPT
-A SMTPOUTPUT -p tcp -m multiport --dports 25,465,587,26 -m owner --uid-owner 0 -j ACCEPT
-A SMTPOUTPUT -p tcp -m multiport --dports 25,465,587,26 -j LOGDROPOUT
(that gid and uid are of cpaneleximfilter, cpanel and root)

And then i add that, but dont work:
-A SMTPOUTPUT -p tcp -m multiport --dports 25,465,587,26 -m owner --uid-owner 1062 -j ACCEPT
-A SMTPOUTPUT -p tcp -m multiport --dports 25,465,587,26 -m owner --gid-owner 1064 -j ACCEPT
(uid 1062 and gid 1064 are the user and group that i testing)

I see that the "CSF firewall" is activated, but i dont know how check if are a problem in that option of WHM.
How i can check of the CSF Firewall is the problem?
Or where i can get the fix?

Thanks!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,202
363
How i can check of the CSF Firewall is the problem?
Hello,

In "WHM >> ConfigServer Security & Firewall", click on "Firewall Configuration" and review your configuration settings under "SMTP Settings". Note that you may want to first temporarily disable CSF and see if the issue persists when it's disabled.

Thank you.