Skip to main content

Problem testing cron for email output

Comments

30 comments

  • cPanelMichael
    Hello :) Have you tried using an alternative PHP mailer script just to rule out any issues with the existing script you are using? There are several PHP test scripts used for mailing that you can find on a search engine. Thank you.
    0
  • magicalwonders
    I'm pretty sure that this is not a problem with the script itself. I tried installing the script on another domain on the server but I'm getting an Internal Server error returned. I've also noticed that all my wordpress sites have not been emailing any backups since migrating to new VPS. I had this problem once before on the old VPS, and it was something to do with a php setting on the server? I've looked in the error logs and there are a few that might be relevant ? [QUOTE][Tue Sep 02 15:32:24 2014] [notice] Status engine is currently disabled, enable it by set SecStatusEngine to On. [Wed Sep 10 07:06:27 2014] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?) [Wed Sep 10 07:06:27 2014] [warn] RSA server certificate CommonName (CN) `webhost1.domain.com' does NOT match server name!? [Wed Sep 10 07:06:27 2014] [emerg] mod_qos(007): could not determine MaxClients/MaxRequestWorkers! You MUST set this directive within the Apache configuration file. [Wed Sep 10 16:51:33 2014] [error] [client 91.125.145.246] suexec failure: could not open log file [Wed Sep 10 16:51:33 2014] [error] [client 91.125.145.246] fopen: Permission denied [Wed Sep 10 16:51:33 2014] [error] [client 91.125.145.246] Premature end of script headers: arp3-install.pl
    Extract from suexec log [QUOTE][2014-09-10 19:26:58]: file has no execute permission: (/home/internet/public_html/cgi-bin/arp3/arp3-install.pl)
    The last four errors refer to my attempt to install the script that has stopped sending reports by email. It looks like some sort of permissions issue? Edit. It looks like my Wordpress sites are sending backups on other the cPanels on my VPS. I'm pretty sure they are failing on my account though. I'll know for sure by tomorrow as the next one is due tonight!
    0
  • magicalwonders
    I would like to test if php is able to send mail properly, and have found the following info. But am not 100% sure on where to upload the script? - [QUOTE]First check if PHP-scripts can send emails php -a mail ('admin@mydomain.com', "Test Postfix", "Test mail from postfix"); exit (); Note: if after running php -a, you get "Interactive mode enabled" message but no php> prompt, then your PHP is not compiled with readline support. If its working nice, you will get only "Interactive mode" message with php> prompt. You can still run test though. Just create a testmail.php with following lines of codes: and run it on your server with php -f testmail.php command. If you can"t see any email form PHP, then that means its PHP"s fault.
    Do I upload the testmail.php file to root of my server? Then just enter php -f testmail.php on the command line? have I understood this correctly?? EDIT. I can see that this is really the same script that I have already used! If I specify my primary address, nothing comes through! If I use an address on the server, the message makes it into the mailbox but does not get forwarded. I've tested the same script on my other VPS and that successfully sends mail to my primary. Not sure how to proceed. It feels like I'm doing all the work that my host should be doing!
    0
  • cPanelMichael
    Have you checked to see if you are using the same PHP handler, as configured in "WHM Home " Service Configuration " Configure PHP and suEXEC"? Thank you.
    0
  • magicalwonders
    [quote="cPanelMichael, post: 1729041">Have you checked to see if you are using the same PHP handler, as configured in "WHM Home " Service Configuration " Configure PHP and suEXEC"? Thank you.
    Funny enough, my support asked the same question a couple of hours ago! I wasn't really sure how to find out the info as they didn't give the location like you have. I've supplied them with my old VPS login credentials so they can check. This problem coincides with a ticket they were working on to authenticate SPF and DKIM records. I don't know all the changes they made in that regard, but they did notify me of the following - [QUOTE]Upon checking we could see that reference /etc/mailips for SMTP outgoing connection is disabled in the server and we have enabled it.
    That seemed to fix the SPF and DKIM, but I'm wondering if it could have messed up the Mail at the same time?
    0
  • cPanelMichael
    It seems more likely to be an issue with PHP sending out the email if you do not see any entries in /var/log/exim_mainlog for the messages you are sending. Thank you.
    0
  • magicalwonders
    OK I'll try and check those logs. I've managed to compare the configuration of php and suEXEC on the servers, and they are a bit different! The old VPS shows this as current configuration [QUOTE]Default PHP Version (.php files) 5 PHP 5 Handler suphp Apache suEXEC on Apache Ruid2 off
    And the new one as follows - [QUOTE]Default PHP Version (.php files) 5 PHP 5 Handler suphp Apache suEXEC off Apache Ruid2 off
    I'm not sure what the consequences of this difference is.
    0
  • magicalwonders
    I've had a look in the exim logs and there is definitely a problem with my mail configuration. The reject log shows the following error in respect of the mail sent by my autoresponder script - I've changed the actual email address for this post so it doesn't get harvested. 2014-09-14 07:54:01 H=ns2.domain.com (webhost1.domain.com) [138.128.xxx.xx]:49233 rejected MAIL : "REJECTED - Bad HELO - Host impersonating [webhost1.domain.com]" 2014-09-14 07:54:02 H=ns2.domain.com (webhost1.domain.com) [138.128.xxx.xx]:53206 rejected MAIL <>: "REJECTED - Bad HELO - Host impersonating [webhost1.domain.com]"
    The above domain is on a dedicated IP address, but no reverese DNS has been setup yet. I've looked at the email for the other accounts which are on a shared IP and they are having problems too! I tried sending mail to one of my domains and it shows the following in the Exim reject log - 2014-09-14 09:02:43 H=avasout02.otherdomain.net [212.159.xx.xx]:50969 F= temporarily rejected RCPT : lowest numbered MX record points to local host 2014-09-14 09:02:44 H=avasout02.otherdomain.net [212.159.xx.xx]:50969 F= temporarily rejected RCPT : lowest numbered MX record points to local host
    From what I can see, mail to all the other addresses in the accounts are showing the same error. Any ideas on what's gone wrong and how to fix this would be appreciated! :)
    0
  • cPanelMichael
    You should configure "Apache suEXEC" to "ON" to match your source server if you prefer the same setup. [QUOTE]2014-09-14 09:02:43 H=avasout02.otherdomain.net [212.159.xx.xx]:50969 F= temporarily rejected RCPT : lowest numbered MX record points to local host
    Make sure the domain name is in your /etc/localdomains file if it's email is handled locally. Thank you.
    0
  • magicalwonders
    [quote="cPanelMichael, post: 1730101">You should configure "Apache suEXEC" to "ON" to match your source server if you prefer the same setup. Make sure the domain name is in your /etc/localdomains file if it's email is handled locally. Thank you.
    Thank you Michael, I'll turn "Apache suEXEC" to "ON" as suggested. I've looked in the /etc/localdomains file as they mentioned today that one of the domains was missing. I can see that another domain is also missing, and none of the addon domains in the accounts are listed. Should addon domains be in this file? At the top of this file it has - server.yourdomain.com That doesn't sound right? Shouldn't there be a domain name after server.? I've also asked my host to setup reverse DNS for my domain on the dedicated IP. This is the setup I had on my other VPS and it all seemed to work OK. They've responded with the following question - [QUOTE]Could you please update us the PTR record needed for the IP address which is mentioned below, so that we can set the rDNS for you.
    I'm not sure where to find this information? Hope you can advise. Many thanks, Myles
    0
  • cPanelMichael
    Hello :) 1. Yes, it's normal to see your hostname in this file. Browse to "WHM Home " DNS Functions " Edit DNS Zone" and for each domain name that's missing set the "Email Routing" to: "Local Mail Exchanger" 2. You can provide them with the hostname of your server, as it's generally recommended that you use it in the PTR record for your IP addresses. Thank you.
    0
  • magicalwonders
    Thanks Michael, I've updated my host, and requested the relevant changes. I'll take a look tomorow and hopefully they'll have made some progress. :)
    0
  • magicalwonders
    I can't see that my host has made any changes or progress, so I'm going to try and make the necessary changes myself. I'll try and fix one domain at a time, starting with my site that's on a dedicated IP address. I've attached the output from the error log for the last email triggered by my cron - Views best in Notepad++ I've had a look in the "Edit DNS zone" and the entries don't look quite right to me, so maybe this is the cause of my woes for this domain. Screenshot included. .vB The IP address for this domain is assigned to NS2 in my private nameservers with the domain registrar. However, the nameserver for NS1 which is the shared IP has been used twice in the server configuration. That doesn't feel right to me? Also, I'm not sure if the third column at the top where is says - "youremailid.domain.com." needs and entry? Am I on the right track regarding the use of NS1 in the above setup? Many thanks, Myles
    0
  • cPanelMichael
    Hello :) The issue with the domain name's existence in the /etc/remotedomains file instead of the /etc/localdomains file is the primary cause of this problem as I see it. Please ensure you correct that before proceeding to troubleshoot further. I don't see any problems with the DNS configuration. Thank you.
    0
  • magicalwonders
    Thanks for the help Michael, I've made some progress now. Mail to all the boxes on the shared IP now seem to be working OK. I did some further tests on the problem of getting system and scripts mail delivered to my magicalwonders domain on the dedicated IP. It looks like my IPS has been blocking them. I have removed the spam filter from my ISP mailbox and I'm now getting system messages from the server. It looks like a mistake was made when setting up rDNS, so I'm hoping when that resolves, the mail generated from scripts will then get through. The domain names now all seem to be present in the /etc/localdomains file, however the top entry is still showing as server.yourdomain.com Is this file edited directly, or do I need to enter correct info somewhere else? [Removed - Actual Domain Nmaes] The remote domains file has a slightly different looking list - [Removed - Actual Domain Nmaes] I'm not sure what is supposed to be on this list? It seems to be missing names that are on the local domain file. Again, is it edited directly if needed? Many thanks, Myles
    0
  • cPanelMichael
    It's normal to see the hostname at the top of that file. It's supposed to be there. You can automatically populate those files with this command: /usr/local/cpanel/scripts/checkalldomainsmxs
    However, ensure you manually add the hostname to the top of /etc/localdomains after you run the above command. Thank you.
    0
  • magicalwonders
    [quote="cPanelMichael, post: 1730811"> However, ensure you manually add the hostname to the top of /etc/localdomains after you run the above command. Thank you.
    Thanks Michael, Is it OK to just download the localdomains file, edit it, and then re-upload it? Or do I have to edit the fille via SSH in something like Nano?
    0
  • cPanelMichael
    [quote="magicalwonders, post: 1731001">Thanks Michael, Is it OK to just download the localdomains file, edit it, and then re-upload it? Or do I have to edit the fille via SSH in something like Nano?
    Edit it via SSH with "nano" or "vi" to ensure invalid characters are not added to the file when modified with a non-unix text editor. Thank you.
    0
  • magicalwonders
    [quote="cPanelMichael, post: 1731012">Edit it via SSH with "nano" or "vi" to ensure invalid characters are not added to the file when modified with a non-unix text editor. Thank you.
    Ah, OK. Thanks for the heads up! :)
    0
  • magicalwonders
    Hello Michael, I ran the command - /usr/local/cpanel/scripts/checkalldomainsmxs and it comes up with the following warning/advice, so I want to check with you before taking the next step - [QUOTE]This script will check each MX entry for every domain configured on this machine. The MX record will be determined from the zone file associated with this server, not from a remote query of the DNS record. If you are using and editing the zone file on a server not associated with this server through a DNS cluster configuration, then this utility will configure your email settings incorrectly. This utility updates the following files which alter the local delivery and sending methods of email: /etc/localdomains /etc/remotedomains /etc/secondarymx As a safety precaution you must run this utilty with the argument "--yes" to proceed.
    I'm wondering if having these domains still present on another VPS is likely to cause a problem? I have now got rDNS setup for my domain on the dedicated IP. However, the dedicated IP on my old VPS (198.23.157.249) when checking rDNS, resolves to mail.mydomain.com and the dedicated IP on the new server (138.128.161.28) resolves to mydomain.com Is having two IPs resolving to the same domain a problem? Many thanks, Myles
    0
  • cPanelMichael
    Yes, that output is normal. Please ensure you read it before proceeding, and use the "--yes" flag when you are ready to enter the command. It's fine to have two IP addresses with reverse DNS records pointing to the same domain name. Thank you.
    0
  • magicalwonders
    OK thanks Michael, I've gone ahead and run that command and updated the localdomains file with my server hostname at the top. :) The mail problem is almost solved. I'm getting system mails from the server, and messages sent by Wordpress. :) However, the reports sent by my autoresponder script are still getting rejected by my ISP. :( I've just triggered a few reports, and this is the extract from the Exim log - [QUOTE]2014-09-18 14:35:02 cwd=/home/magicalw 6 args: /usr/sbin/sendmail -f arplus@mydomain.com -t -oi -oem 2014-09-18 14:35:02 1XUbrS-00066V-7v <= arplus@mydomain.com U=magicalw P=local S=2160 id=205416_237611_557461_682228@mydomain.com T="AutoResponse Plus Activity Report - 18 Sep 2014" for myles@mydomain.com 2014-09-18 14:35:02 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1XUbrS-00066V-7v 2014-09-18 14:35:02 SMTP connection from [138.128.161.28]:41689 (TCP/IP connection count = 1) 2014-09-18 14:35:02 H=mydomain.com (webhost1.internetgeeksquad.com) [138.128.161.28]:41689 rejected MAIL : "REJECTED - Bad HELO - Host impersonating [webhost1.internetgeeksquad.com]" 2014-09-18 14:35:02 SMTP connection from mydomain.com (webhost1.internetgeeksquad.com) [138.128.161.28]:41689 closed by DROP in ACL 2014-09-18 14:35:02 1XUbrS-00066V-7v ** myles@mydomain.com R=deliver_local_outside_jail T=remote_smtp: SMTP error from remote mail server after MAIL FROM: SIZE=3257: host 127.0.0.1 [127.0.0.1]: 550 "REJECTED - Bad HELO - Host impersonating [webhost1.internetgeeksquad.com]" 2014-09-18 14:35:02 cwd=/var/spool/exim 7 args: /usr/sbin/exim -t -oem -oi -f <> -E1XUbrS-00066V-7v 2014-09-18 14:35:02 1XUbrS-00066c-KA <= <> R=1XUbrS-00066V-7v U=mailnull P=local S=3224 T="Mail delivery failed: returning message to sender" for arplus@mydomain.com 2014-09-18 14:35:02 1XUbrS-00066V-7v Completed 2014-09-18 14:35:02 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1XUbrS-00066c-KA 2014-09-18 14:35:02 SMTP connection from [138.128.161.28]:43516 (TCP/IP connection count = 1) 2014-09-18 14:35:02 H=mydomain.com (webhost1.internetgeeksquad.com) [138.128.161.28]:43516 rejected MAIL <>: "REJECTED - Bad HELO - Host impersonating [webhost1.internetgeeksquad.com]" 2014-09-18 14:35:02 SMTP connection from mydomain.com (webhost1.internetgeeksquad.com) [138.128.161.28]:43516 closed by DROP in ACL 2014-09-18 14:35:02 1XUbrS-00066c-KA ** arplus@mydomain.com R=deliver_local_outside_jail T=remote_smtp: SMTP error from remote mail server after MAIL FROM:<> SIZE=4344: host 127.0.0.1 [127.0.0.1]: 550 "REJECTED - Bad HELO - Host impersonating [webhost1.internetgeeksquad.com]" 2014-09-18 14:35:02 1XUbrS-00066c-KA Frozen (delivery error message)
    I don't understand why it keeps producing [QUOTE]"REJECTED - Bad HELO - Host impersonating [webhost1.internetgeeksquad.com]"
    There must be some configuration still not right, as I can send the same report from my other VPS from the same domain name, and that gets through without a problem. ?
    0
  • cPanelMichael
    Check to ensure the RDNS entry for your primary IP address matches the hostname of the server, and the "A" record for the hostname points to that IP. Thank you.
    0
  • magicalwonders
    [quote="cPanelMichael, post: 1732761">Check to ensure the RDNS entry for your primary IP address matches the hostname of the server, and the "A" record for the hostname points to that IP. Thank you.
    The rDNS for the primary IP seems to be resolving to the hostname OK - [QUOTE]138.128.161.22 resolves to "webhost1.internetgeeksquad.com" Top Level Domain: "internetgeeksquad.com"
    The mail that is having a problem though is coming from a domain on a dedicated IP. I'm not sure which file to check to make sure the "A" record for the hostname points to the primary IP ? EDIT: I've done a bit of googling! Is the file to examine etc/resolve.conf ? That shows the following - [QUOTE]nameserver 8.8.8.8 nameserver 8.8.4.4
    0
  • cPanelMichael
    No, your resolvers are separate and you should not modify them. Use the "Edit a DNS Zone" feature in WHM to update or create the "A" record for your hostname if it does not yet exist. It's likely a better idea to open a support ticket for the final issue so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome. Thank you.
    0
  • magicalwonders
    [quote="cPanelMichael, post: 1732921">No, your resolvers are separate and you should not modify them. Use the "Edit a DNS Zone" feature in WHM to update or create the "A" record for your hostname if it does not yet exist. It's likely a better idea to open a support ticket for the final issue so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome. Thank you.
    OK thanks Michael, I think a support ticket is probably a good idea. I had a look in the "Edit a DNS Zone", amd although it lists my domains, it doesn't seem to include my hostname. I assume I'm looking for something like hostname.mydomain.com ?
    0
  • cPanelMichael
    [quote="magicalwonders, post: 1732972">I had a look in the "Edit a DNS Zone", amd although it lists my domains, it doesn't seem to include my hostname. I assume I'm looking for something like hostname.mydomain.com ?
    Check to make sure your hostname does not have it's own DNS zone as well. Thank you.
    0
  • magicalwonders
    [quote="cPanelMichael, post: 1733122">Check to make sure your hostname does not have it's own DNS zone as well. Thank you.
    Not quite sure where to find that. I've raised a ticket on this now, Support Request Id 5477467. Hopefully a tech will be able to give the settings the once over and see where things have gone amiss! :)
    0
  • magicalwonders
    I'm pleased to report that this item is now resolved. :) I received the following explanation and advise - [QUOTE]Please review the router: --------- [06:57:23 webhost1 root@5477467 ~]cPs# awk /^deliver_local_outside_jail/,/^$/ /etc/exim.conf deliver_local_outside_jail: driver = manualroute domains = +local_domains # users outside the jail will not be in /etc/passwd => We need to check if $local_part is in /jail_owner # we can't just check to see if they exist # because we still want to be able to mail root condition = ${if exists {/jail_owner}{1}{0}} transport = remote_smtp route_list = "* 127.0.0.1" # self = send allows us to send outside the jail # we make sure /home/virtfs does not exist before we get here # to be safe self = send [06:57:56 webhost1 root@5477467 ~]cPs# --------- You can see that the transport used is "remote_smtp", so the rules that apply to the connection are those normally imposed on remote clients. However, connections for jailed users still connect to 127.0.0.1, the localhost IP. Thus, the client's incoming IP address that exim "sees" is 127.0.0.1, and therefore the check, "Require remote (hostname/IP address) HELO", causes the connection to fail. To work around this issue, you can continue to leave this option disabled, or you can alternatively change the affected user's shell to "Normal shell", which will allow the user's mail delivery process to run in a normal shell instead of jailed shell and thus not be affected by the remote_smtp router + local IP discrepancy.
    0
  • cPanelMichael
    I am happy to see the issue is now resolved. Thank you for updating us with the outcome.
    0

Please sign in to leave a comment.