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.

I do not recieve email from server when mx record points somewhere else

Discussion in 'E-mail Discussions' started by WebAddict, Jan 29, 2005.

  1. WebAddict

    WebAddict Member

    Joined:
    Jun 26, 2003
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    On one of my websites, I host the email through another email service, and have the MX records pointing to that service. Mail is recieved just fine to the account, except when sent from the website server. I have removed the entry for the website from my /etc/localdomains file, but still no luck.

    apache 1.3.33
    bind 9.2.4
    exim (exim-4.44-0_cpanel_smtpctl_av_rewrite_mm2_mmmtrap_exiscan_md5pass)
     
  2. vibz

    vibz Member

    Joined:
    Jan 24, 2005
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Hi dude,

    See if the change in MX is updated properly on the 'website server'.

    dig MX yourdomainname.com

    Vibz
     
  3. WebAddict

    WebAddict Member

    Joined:
    Jun 26, 2003
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    The MX record is just fine, we recieve email as we should. And we don't have problems when sending messages from other users and domains on the same server. The only problem that we have is that the emails from our php scripts on the website do not deliver. We use a contact us form that uses the php mail() function. These scripts worked fine until we moved to a new server the other day. The scripts work just fine delivering to users on that same server, but not to those that host thier website but not thier mail there. I have run several tests including WHM's 'Mail Troubleshooter' program. Everything seems to be pointed correctly.

    After reading about similar problems, I even created an /etc/remotedomains file and added the single entry with the domain name. That didn't work either. If someone could help, that'd be great.
     
  4. rpmws

    rpmws Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    1,824
    Likes Received:
    5
    Trophy Points:
    38
    Location:
    back woods of NC, USA

    make sure that domain is listed in /etc/remotedomains if you want locl mail to deliver to an outside MX setting. Make sute the domain is NOT in that file if you do want local mail to deliver to localy. Also the /etc/localdomains file should have it in there if the mail is supposed to deliver locally as well.

    Make sure sites on that box have their domain in the /etc/localdomains file. and make sure sites that are gone from that box do NOT have that domain listed in there. If it is exim will try to deliver locally and even follow /etc/valiases/domain.com if it's there. The delete scripts for WHM need to clean things up a bit better.
     
    #4 rpmws, Jan 29, 2005
    Last edited: Jan 29, 2005
  5. DigitalN

    DigitalN Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    420
    Likes Received:
    1
    Trophy Points:
    18
    To see where exim is delivering (resolving the mail) login to your server

    and type

    # exim -d -bt your@email.com

    This will tell you where exim is seeing that it needs to send the mail to.
    If there are errors or exim is routing local, the MX, dns and other things should be checked again.
     
  6. WebAddict

    WebAddict Member

    Joined:
    Jun 26, 2003
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Very insightfull... Here is the result...

    Code:
    # exim -d -bt jerry@b2bcfo.com
    Exim version 4.44 uid=0 gid=0 pid=8933 D=fbb95cfd
    Berkeley DB: Sleepycat Software: Berkeley DB 4.1.25: (August 21, 2003)
    Support for: iconv() PAM Perl OpenSSL
    Lookups: lsearch wildlsearch nwildlsearch iplsearch dbm dbmnz
    Authenticators: cram_md5 plaintext spa
    Routers: accept dnslookup ipliteral manualroute queryprogram redirect
    Transports: appendfile autoreply pipe smtp
    changed uid/gid: forcing real = effective
      uid=0 gid=0 pid=8933
      auxiliary group list: <none>
    configuration file is /etc/exim.conf
    log selectors = 00000ffc 00010400
    trusted user
    admin user
    finduser used cached passwd data for mailman
    originator: uid=0 gid=0 login=root name=root
    sender address = root@rs2.surfexperts.com
    Address testing: uid=0 gid=12 euid=0 egid=12
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    Testing jerry@b2bcfo.com
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    Considering jerry@b2bcfo.com
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    routing jerry@b2bcfo.com
    --------> mailman_virtual_router router <--------
    local_part=jerry domain=b2bcfo.com
    checking require_files
    file check: /usr/local/cpanel/3rdparty/mailman/lists/${lc:$local_part}_${lc:$domain}/config.pck
    expanded file: /usr/local/cpanel/3rdparty/mailman/lists/jerry_b2bcfo.com/config.pck
    stat() yielded -1
    errno = 2
    mailman_virtual_router router skipped: file check
    --------> mailman_virtual_router_nodns router <--------
    local_part=jerry domain=b2bcfo.com
    checking domains
    search_open: lsearch "/etc/localdomains"
    search_find: file="/etc/localdomains"
      key="b2bcfo.com" partial=-1 affix=NULL starflags=0
    LRU list:
      :/etc/localdomains
      End
    internal_search_find: file="/etc/localdomains"
      type=lsearch key="b2bcfo.com"
    file lookup required for b2bcfo.com
      in /etc/localdomains
    lookup failed
    b2bcfo.com in "lsearch;/etc/localdomains"? no (end of list)
    b2bcfo.com in "+local_domains"? no (end of list)
    mailman_virtual_router_nodns router skipped: domains mismatch
    --------> lookuphost router <--------
    local_part=jerry domain=b2bcfo.com
    checking domains
    cached no match for +local_domains
    cached lookup data = NULL
    b2bcfo.com in "! +local_domains"? yes (end of list)
    checking "condition"
    Starting Perl interpreter
    calling lookuphost router
    lookuphost router called for jerry@b2bcfo.com
      domain = b2bcfo.com
    DNS lookup of b2bcfo.com (MX) succeeded
    DNS lookup of hm-mx1.solinus.com (A) succeeded
    66.18.18.26 in "0.0.0.0 : 127.0.0.0/8 : 64.94.110.0/24"? no (end of list)
    fully qualified name = b2bcfo.com
    host_find_bydns yield = HOST_FOUND (2); returned hosts:
      hm-mx1.solinus.com 66.18.18.26 MX=0
    set transport remote_smtp
    queued for remote_smtp transport: local_part = jerry
    domain = b2bcfo.com
      errors_to=NULL
      domain_data=NULL localpart_data=NULL
    routed by lookuphost router
      envelope to: jerry@b2bcfo.com
      transport: remote_smtp
      host hm-mx1.solinus.com [66.18.18.26] MX=0
    jerry@b2bcfo.com
      router = lookuphost, transport = remote_smtp
      host hm-mx1.solinus.com [66.18.18.26] MX=0
    search_tidyup called
    >>>>>>>>>>>>>>>> Exim pid=8933 terminating with rc=0 >>>>>>>>>>>>>>>>
    
    The result shows that the exim routing is working correctly. Now what do I do? I assume it is something to do with the way that php is set up. Any help?
     
  7. Jemshi

    Jemshi Well-Known Member

    Joined:
    Sep 11, 2003
    Messages:
    210
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    What does the exim logs (on web server) say when you send mail from it.
     
  8. vibz

    vibz Member

    Joined:
    Jan 24, 2005
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Dude!!! looks like this is an issue with the dns. I understand that the MX is fine on all other parts of the Internet. But are you sure if it is updated correctly on the server? This sometimes happen if the servers have dns clustered. The main dns servers will have the correct MX whereas the local server where the website is hosted still resolves the old MX. Check your /etc/resolv.conf and make sure that the nameservers listed are your dns servers. You can cofirm this using the dig command on the server.

    And even if your servers are not clustered check "cat /etc/resolv.conf". It should be something like this.

    ################################################
    nameserver nameserver1
    nameserver nameserver2
    ################################################

    dig MX @nameserver1 yourdomainname.com

    If the results shows MX correctly, then I'm sorry! :D

    Vibz
     
Loading...

Share This Page