Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

remote email server

Discussion in 'E-mail Discussion' started by kazaa, Feb 2, 2013.

  1. kazaa

    kazaa Member

    Joined:
    Apr 11, 2006
    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    153
    Hi I am having trouble with sending emails.

    I have 2 servers set up. Server A is used for webhosting and server B is used as an email server for all the domains that are setup on server A. Both servers are using cpanel.

    I can connect to server B using smtp from home or anywhere else really and I can see in the logs that server B handles the emails just fine. Emails get sent and received just fine in that case.

    But when I send an email from my website which is hosted on server A, server A is somehow delivering the emails. So when I send an email to me@mydomain.com using php, server A attempts to deliver the message but it fails with "REJECTED - Bad HELO - Host impersonating [mydomain.com]"

    I have dns for all domains on Server A set up as "Remote Mail Exchanger" but the server still attempts to send all mail that is sent directly from my websites.

    I should mention that I am using phpmailer class to send emails using smtp from my websites and prior to december 26th everything was working fine. I set this up sometime in August.

    HOpe you guys can help.
    Thanks
     
    #1 kazaa, Feb 2, 2013
    Last edited: Feb 2, 2013
  2. Greenhost

    Greenhost Well-Known Member

    Joined:
    Jan 22, 2013
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Have you set your php.ini as SMTP?
    If so, no it is not. to check/change your PHP mail configuration:

    1. Open your php.ini file (if you don't know where this is, see below)
    2. Search for the line that reads [mail function]
    3. Add/change the details of your mail server. This could be a local mail server or the mail server of your ISP.
    4. Save/close the php.ini file
    5. Restart your web server

    Here's a code you should set on php.ini file:
    Code:
    [mail function]
    sendmail_path = Server B IP;
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #2 Greenhost, Feb 2, 2013
    Last edited: Feb 2, 2013
  3. kazaa

    kazaa Member

    Joined:
    Apr 11, 2006
    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    153
    Thanks for your suggestion greenhost, I tried it but it made no difference.
     
  4. kazaa

    kazaa Member

    Joined:
    Apr 11, 2006
    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    153
    Little more info.
    My MX record is setup as mail.mydomain.com, mail.mydomain.com's A record points to the ip address of Server B. Like I said this setup had worked for a few months prior to Dec 26.
     
  5. Greenhost

    Greenhost Well-Known Member

    Joined:
    Jan 22, 2013
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    It's a little complicated, if your MX, and php mail configuration -as smtp setting not mail setting- is setup normal y, it must be work. :confused:
    Check your mail log in cPanel, if you couldn't find anything shear here. It will be helpful. ;)
    that I'm aware of.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #5 Greenhost, Feb 4, 2013
    Last edited: Feb 4, 2013
  6. max_payne

    max_payne Active Member

    Joined:
    Feb 1, 2013
    Messages:
    33
    Likes Received:
    1
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Have you tried viewing the mail logs for more information:

    On server A, run the following as you fill out the form that sends emails:

    tail -f /var/log/exim_mainlog

    Normally mail sending scripts will send from the server itself. The sending email address will look something like nobody@example.hostname.com, unless the script itself has SMTP authentication enabled and is sending from a real email address instead. I suspect your web server (server A) was sending these emails all along.

    See if the logs provide you with any further information besides the 'REJECTED - Bad HELO - Host impersonating' message. I also suggest deleting DNS zone files on the server they are not live on just to avoid conflict. Next, look at your /etc/resolv.conf file to see if it looks okay. I have seen this file get 'reset' after cPanel updates and cause issues with mail.
     
  7. kazaa

    kazaa Member

    Joined:
    Apr 11, 2006
    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    153
    I finally figured it out, after several hours trouble shooting DNS and email logs etc it ended up being a setting in
    WHM. I dont know how this setting got turned on but it did some how and I was totally aware of it.

    In case someone else has the same issue here is the setting I had to turn off.
    tweak settings->Mail->Restrict outgoing SMTP to root, exim, and mailman (FKA SMTP Tweak).

    Thanks guys for your time and support.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice