Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 11 of 11
  1. #1
    Member
    Join Date
    May 2004
    Posts
    14

    Unhappy Mail from account web scripts ALWAYS rejected by gmail, yahoo. hotmail etc.

    Hi All,

    I have one particular account which must be able to send mail from a php script.

    Unfortunately the sending domain always displays as my WHM server's domain. As a result the mail is rejected by MANY email providers.

    I have tried: Changing the Sending IP for Outbound Email in Exim implemented to a T and still all config mods i've made are ignored.

    I have also tried setting the interface directly to the IP i want to mail to go out on (this PTR for the domain i set resolves to the correct domain i need to send mail from) and STILL the emails show as being sent from my WHM server's hostname which reverse DNS resolves to the main non-shared IP..

    I am at a loss. It seems as though EXIM is ignoring all attempts to make changes. I have restarted exim for every attempt and still nothing seems to effect which ip/domain the mail is sent from.

    I am positive many people knowingly or unknowingly are having sharedIP accounts mail being rejected by top domains because of this issue. Please HELP!

  2. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Mail from account web scripts ALWAYS rejected by gmail, yahoo. hotmail etc.

    If your PHP script is using the PHP mail() function or sendmail, exim is not used for sending the emails. In this instance, it is instead using sendmail, which bypasses the exim options and checks.

    The script would need to be revised to use SMTP authentication instead of the PHP mail() function. When using SMTP to authenticate as a set user with a password, you should then be able to send using exim directly. If this does not work for sending the email with the correct domain name and IP, please provide a copy of the script for us to review.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  3. #3
    Member
    Join Date
    May 2004
    Posts
    14

    Default Re: Mail from account web scripts ALWAYS rejected by gmail, yahoo. hotmail etc.

    Quote Originally Posted by cPanelTristan View Post
    If your PHP script is using the PHP mail() function or sendmail, exim is not used for sending the emails. In this instance, it is instead using sendmail, which bypasses the exim options and checks.

    The script would need to be revised to use SMTP authentication instead of the PHP mail() function. When using SMTP to authenticate as a set user with a password, you should then be able to send using exim directly. If this does not work for sending the email with the correct domain name and IP, please provide a copy of the script for us to review.

    Hi Thanks for the reply. Well that explains why the php mail() version of the script was not looking at the EXIM settings.

    Now i am trying to use SMTP auth and i am unable to connect to the server. I would guess there are some security settings blocking maybe user accounts on the localhost from authenticating? Any ideas why my script wouldn't be able to connect? Thanks!

  4. #4
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Mail from account web scripts ALWAYS rejected by gmail, yahoo. hotmail etc.

    Are you using CSF on the machine? If so, can you ensure SMTP isn't blocked for localhost for users authenticating that way? The settings you'd check would be SMTP_BLOCK and SMTP_ALLOWLOCAL ones.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  5. #5
    Member
    Join Date
    May 2004
    Posts
    14

    Default Re: Mail from account web scripts ALWAYS rejected by gmail, yahoo. hotmail etc.

    Specifically, the connection times out. But i can use the exact same settings in a mail reader (firebird, outlook etc) and it works fine. Same acct, password, domain....

  6. #6
    Member
    Join Date
    May 2004
    Posts
    14

    Default Re: Mail from account web scripts ALWAYS rejected by gmail, yahoo. hotmail etc.

    I've tried changing these but specifically what should they be set to? Both to 0? I am not using SMTP Tweak (disabled)

  7. #7
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Mail from account web scripts ALWAYS rejected by gmail, yahoo. hotmail etc.

    They should both be set to 0 during the troubleshooting process. If that does work, then change both to 1 after that point to see if it still works. If it doesn't, you'll have no choice but to keep them at 0 (disabled).
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  8. #8
    Member
    Join Date
    May 2004
    Posts
    14

    Default Re: Mail from account web scripts ALWAYS rejected by gmail, yahoo. hotmail etc.

    Working now. Thanks, i set both SMTP_BLOCK and SMTP_ALLOWLOCAL to 0 (any security implications i should think about?) and working fine now.

    But this is what the header looks like:

    from frxxxxxt.ca ([66.207.198.77] helo=66.207.xxx.xxx)
    by sparky.xxxxxxxx.com with esmtpa (Exim 4.69)

    There is a PTR for 66.207.xxx.xxx which resolves to frxxxxxt.ca.. how do i get rid of the 'by sparky.xxxxxxxx.com'??

    Thanks a ton!

  9. #9
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Mail from account web scripts ALWAYS rejected by gmail, yahoo. hotmail etc.

    Is the following set in WHM > Exim Configuration Editor area?

    Set the Sender: Header when the mail sender changes the sender (-f flag passed to sendmail). [?]

    Always set the "Sender:" header when the sender differs from the actual sender. Unchecking this will stop "On behalf of" data in Microsoft® Outlook, but may limit your ability to track abuse of the mail system.
    If that is set to "On" then change it to "Off"
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  10. #10
    Member
    Join Date
    May 2004
    Posts
    14

    Default Re: Mail from account web scripts ALWAYS rejected by gmail, yahoo. hotmail etc.

    Hi Tristan thanks for all your help. Doesn't seem to be an issue as all the domains that were rejecting mail before this all started are now accepting mail from this script, which is great news. So thanks again!

  11. #11
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Mail from account web scripts ALWAYS rejected by gmail, yahoo. hotmail etc.

    Certainly, I'm glad it's now resolved. Great news!
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

Similar Threads & Tags
Similar threads

  1. Mail rejected by GMAIL
    By lordmwesh in forum E-mail Discussions
    Replies: 3
    Last Post: 07-05-2007, 04:05 AM
  2. can't send mail to yahoo or hotmail
    By techsupport1 in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 02-08-2007, 10:13 PM
  3. Webmail/form headers can't get through junk filters (Hotmail/Yahoo/Gmail)
    By mydomain in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 06-23-2006, 11:11 AM
  4. Can't receive gmail, yahoo mail, etc.
    By gdgray in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 11-19-2005, 11:22 PM
  5. php mail and yahoo hotmail ...
    By Radio_Head in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-19-2004, 05:07 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube