Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Cant send mails with PHPMailer

Discussion in 'E-mail Discussion' started by telmark, Mar 13, 2018.

  1. telmark

    telmark Registered

    Joined:
    Jul 31, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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:
    [root@hosting 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!
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice