1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Understanding DNS and MX Records

Discussion in 'Site & Server Administration' started by Matthew Sayle, Apr 21, 2016.

  1. #1
    I am working on a website where the contact form is not sending emails to any address.

    I checked the wp_mail function using this github code:
    https://gist.github.com/butlerblog/5c9b805529c419b81447

    It shows that the wp_mail function is working - but no emails!

    I decided to take a peek at the DNS and MX records using leafdns.

    [​IMG]

    They gave cpanel access, but they're not using Cpanel webmail.

    I have never seen a setup like this, where a host would use different servers for mail and http.

    Can someone provide some insight here?
     
    Matthew Sayle, Apr 21, 2016 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    Have you checked the server-logs for any issues? Apache/PHP-logs? If there's an issue with the actual sendmail-function, or something, it should be in the logs.
     
    PoPSiCLe, Apr 21, 2016 IP
  3. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #3
    I would use an SMTP plugin to send mail, as the phpmail function (which I believe the wp_mail function is piggy backing on) will send email as the owner/user, and if this is not a valid email address (which is very likely is not) it will be rejected. Are you receiving any bounce back messages?

    Regards,
    Chris
     
    RHS-Chris, Apr 21, 2016 IP
  4. Matthew Sayle

    Matthew Sayle Prominent Member

    Messages:
    3,325
    Likes Received:
    464
    Best Answers:
    1
    Trophy Points:
    385
    #4
    I only see 2 errors in the logs, and they are very strange.
    [Mon Mar 14 10:49:02.268397 2016] [core:error] [pid 22457] (36)File name too long: [client 93.113.125.12:44444] AH00036: access to /we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages failed (filesystem path '/home/generalmi/public_html/we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages')
    [Sat Mar 12 22:59:07.443923 2016] [core:error] [pid 31053] (36)File name too long: [client 137.226.113.7:37086] AH00036: access to /YesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScann failed (filesystem path '/home/generalmi/public_html/YesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScann')
    Code (markup):
    I am not receiving any bounce back messages.
     
    Matthew Sayle, Apr 22, 2016 IP
  5. Matthew Sayle

    Matthew Sayle Prominent Member

    Messages:
    3,325
    Likes Received:
    464
    Best Answers:
    1
    Trophy Points:
    385
    #5
    One more thing, I can't even access the default webmail via domain.com/webmail or the IP address:2095

    I get a "this site can't be reached" error.
     
    Matthew Sayle, Apr 22, 2016 IP
  6. Matthew Sayle

    Matthew Sayle Prominent Member

    Messages:
    3,325
    Likes Received:
    464
    Best Answers:
    1
    Trophy Points:
    385
    #6
    Just tried sending via SendGrid API, still won't work!

    There has to be something going on here.

    SMTP, Default Wp_mail, SendGrid API - nothing works.
     
    Matthew Sayle, Apr 22, 2016 IP
  7. Matthew Sayle

    Matthew Sayle Prominent Member

    Messages:
    3,325
    Likes Received:
    464
    Best Answers:
    1
    Trophy Points:
    385
    #7
    I activated the postman plugin and now I am seeing some errors in the log:

    [22-Apr-2016 04:49:36 UTC] ERROR PostmanWpMail: Exception code=0 message=Could not open socket
    [22-Apr-2016 05:00:42 UTC] ERROR PostmanWpMail: Exception code=451 message=Temporary local problem - please try later
    [22-Apr-2016 05:05:34 UTC] ERROR PostmanWpMail: Guzzle\Http\Exception\CurlException code=0 message=[curl] 6: Couldn't resolve host 'api.sendgrid.com' [url] https://api.sendgrid.com/api/mail.send.json
    [22-Apr-2016 05:06:06 UTC] ERROR PostmanWpMail: Guzzle\Http\Exception\CurlException code=0 message=[curl] 6: Couldn't resolve host 'api.sendgrid.com' [url] https://api.sendgrid.com/api/mail.send.json
    [22-Apr-2016 05:11:37 UTC] ERROR PostmanWpMail: Guzzle\Http\Exception\CurlException code=0 message=[curl] 6: Couldn't resolve host 'api.sendgrid.com' [url] https://api.sendgrid.com/api/mail.send.json
    Code (markup):
     
    Matthew Sayle, Apr 22, 2016 IP
  8. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #8
    The fileNameTooLong errors are some sort of overflow error attempt, I think (as long as those IP-addresses are outside your range), and the last error seems to fail on reaching the sendgrid API - blocked by the hosting provider? Or some issues with their DNS server?
     
    PoPSiCLe, Apr 22, 2016 IP