Skip to main content

Email from php scrip not working anymore

Comments

10 comments

  • g-force
    Hi Arcticbit, I had the same problem and found a quick fix to solve the problem. Please look into this other thread and see if you can do the same : php mail() error: Undefined subroutine &main::maskdir Best regards,
    0
  • arcticbit
    Hello g-force, thanks for the reply, unfortunately the solution don't works for me. This is copy of my exim log: 2016-06-02 13:45:03 cwd=/home/****/public_html 3 args: /usr/sbin/sendmail -t -i 2016-06-02 13:45:03 1b8f-0003T7-AT F=<****@****'.****.com> rejected by non-SMTP ACL: failed to expand ACL string "${if eq{$originator_uid}{${perl{user2uid}{nobody}}}{1}{0}}": Undefined subroutine &main::user2uid called. 2016-06-02 13:45:03 cwd=/var/spool/exim 7 args: /usr/sbin/exim -t -oem -oi -f <> -E1b8f-0003T7-AT 2016-06-02 13:45:03 1b8f-0003T9-Az F=<> rejected by non-SMTP ACL: failed to expand ACL string "${if eq{$originator_uid}{${perl{user2uid}{nobody}}}{1}{0}}": Undefined subroutine &main::user2uid called. 2016-06-02 13:45:03 1b8f-0003T9-Az Error while reading message with no usable sender address (R=1b8f-0003T7-AT): rejected by non-SMTP ACL: local configuration problem 2016-06-02 13:45:03 1b8f-0003T7-AT Child mail process returned status 1 2016-06-02 13:45:25 SMTP connection from [127.0.0.1]:55734 (TCP/IP connection count = 1) 2016-06-02 13:45:25 SMTP connection from (localhost) [127.0.0.1]:55734 closed by QUIT This is the php code i try to execute: $msg = "Test text"; mail("****@****.com","Test Mail",$msg); Does anybody have any idea what the problem is? Do the cpanel developers read this forum? Maybe they can fix this problem in the next version of whm?, or maybe it's a configuration setting in whm? Regards
    0
  • g-force
    In WHM : Home "Server Configuration "Tweak Settings Do you have Enable BoxTrapper spam trap at On? I had to enable it, then did the following : /scripts/upcp --force /scripts/buildeximconf service exim restart After that, I faced the problem on the other thread : php mail() error: Undefined subroutine &main::maskdir
    0
  • Infopro
    Do the cpanel developers read this forum?

    Yes, but this issue seems to be with the script itself. Please feel free to open a ticket to cPanel Technical Support if you wish, but they won't be able to assist you with your script. You might look into making sure your script is authenticating properly by using an actual email account to see if that helps.
    0
  • arcticbit
    You might look into making sure your script is authenticating properly by using an actual email account to see if that helps.

    Yes, smtp auth from other scripts to an actual email account works fine, if that's what you think I should try? (but that's not the issue om my problem) Regards
    0
  • arcticbit
    In WHM : Home "Server Configuration "Tweak Settings Do you have Enable BoxTrapper spam trap at On? I had to enable it, then did the following : /scripts/upcp --force /scripts/buildeximconf service exim restart After that, I faced the problem on the other thread : php mail() error: Undefined subroutine &main::maskdir

    Yes, BoxTrapper spam trap was on. The &main::maskdir error is generated when trying to send email from ZenCart. The second message comes when I try to send from php script above. I'm not comfortable with editing configuration files (/etc/exim.pl), and running scripts from the root account as you suggest. It can quickly lead to new problems. regards,
    0
  • ocbox
    Just spent hours on this, you probably have the same problem. Latest update set permissions incorrectly on /etc/exim.pl You will probably need to chmod 644 /etc/exim.pl then service exim restart I hope this helps someone else
    0
  • Infopro
    Yes, smtp auth from other scripts to an actual email account works fine, if that's what you think I should try? (but that's not the issue om my problem) Regards

    I would. From your error message: 2016-06-02 13:45:03 1b8f-0003T9-Az Error while reading message with no usable sender address (R=1b8f-0003T7-AT): rejected by non-SMTP ACL: local configuration problem
    From the docs for xencart configuration, it seems you can set the script to not use sendmail: zen-cart.com/wiki/index.php/Admin_-_Configuration_-_E-Mail_Options
    SMTP Email Account Mailbox (Admin - Catalog) Enter the mailbox account name (me@example.com) supplied by your host. This is the account name that your host requires for SMTP authentication. Only required if using SMTP Authentication for email. Default: YourEmailAccountNameHere SMTP Email Account Password (Admin - Catalog) Enter the password for your SMTP mailbox. Only required if using SMTP Authentication for email. Default: YourPasswordHere SMTP Email Mail Host (Admin - Catalog) Enter the DNS name of your SMTP mail server. Only required if using SMTP Authentication for email. Default: mail.EnterYourDomain.com SMTP Email Mail Server Port (Admin - Catalog) Enter the IP port number that your SMTP mailserver operates on. Only required if using SMTP Authentication for email. Not used in 1.3.0.2. Default: 25
    This should be a more acceptable way to send email from your script, I think. Not sure if that helps your issue specifically, but its certainly worth setting things up this way proper.
    0
  • arcticbit
    I would. From your error message: From the docs for xencart configuration, it seems you can set the script to not use sendmail: zen-cart.com/wiki/index.php/Admin_-_Configuration_-_E-Mail_Options
    SMTP Email Account Mailbox (Admin - Catalog) Enter the mailbox account name (me@example.com) supplied by your host. This is the account name that your host requires for SMTP authentication. Only required if using SMTP Authentication for email. Default: YourEmailAccountNameHere SMTP Email Account Password (Admin - Catalog) Enter the password for your SMTP mailbox. Only required if using SMTP Authentication for email. Default: YourPasswordHere SMTP Email Mail Host (Admin - Catalog) Enter the DNS name of your SMTP mail server. Only required if using SMTP Authentication for email. Default: mail.EnterYourDomain.com SMTP Email Mail Server Port (Admin - Catalog) Enter the IP port number that your SMTP mailserver operates on. Only required if using SMTP Authentication for email. Not used in 1.3.0.2. Default: 25
    This should be a more acceptable way to send email from your script, I think. Not sure if that helps your issue specifically, but its certainly worth setting things up this way proper.

    I agree that using smtp authentication for email is a more acceptable way to send email from. It must have been an error with the Cpanel installation on my server. I performed a reinstall of CentOS and cpanel on the server, and now everything works as before. I can now send email from php script again (without using smtp auth). Remember to backup accounts on your server before reinstall. regards,
    0
  • Infopro
    A bit extreme I think. Remember to secure your server properly.
    0

Please sign in to leave a comment.