The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'E-mail Discussions' started by mitt, May 4, 2011.

  1. mitt

    mitt Member

    Joined:
    May 11, 2004
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    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. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    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.
     
  3. mitt

    mitt Member

    Joined:
    May 11, 2004
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1

    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. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    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.
     
  5. mitt

    mitt Member

    Joined:
    May 11, 2004
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    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. mitt

    mitt Member

    Joined:
    May 11, 2004
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    I've tried changing these but specifically what should they be set to? Both to 0? I am not using SMTP Tweak (disabled)
     
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    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).
     
  8. mitt

    mitt Member

    Joined:
    May 11, 2004
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    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. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Is the following set in WHM > Exim Configuration Editor area?

    If that is set to "On" then change it to "Off"
     
  10. mitt

    mitt Member

    Joined:
    May 11, 2004
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    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. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Certainly, I'm glad it's now resolved. Great news!
     
Loading...

Share This Page