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.

Email problem between servers

Discussion in 'E-mail Discussions' started by cyanide, Jan 30, 2005.

  1. cyanide

    cyanide Well-Known Member

    Joined:
    Aug 11, 2003
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Toronto, Canada
    OKay, here's my problem.

    I have 2 servers. On each of them I have a reseller account using my domain name
    such as :
    server1 : ns1/ns2.mydomain.com
    server2 : ns3/ns4.mydomain.com

    Server1 is the actual location of the website and where I collect my emails.
    I can receive email from anywhere except Server2. Domains sending from Server2 think mydomain.com is on the same server so it doesn't get forwarded.
    I ended up having to create another account inOutlook using the ns3 ip address in order to get these emails.

    On a previous server I didn't have this problem. I just edited the mx record to point to the ip address of ns1. However, it doesn't seem to work here.

    Anyone with a clue, please >?
     
  2. DigitalN

    DigitalN Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    420
    Likes Received:
    1
    Trophy Points:
    18
    You need to contact your host and have them place your domain name into

    /etc/remotedomains

    then

    remove the domain from

    /etc/localdomains (or run /scripts/mailperm)

    Exim will then not route locally the mail on server 2.
     
  3. cyanide

    cyanide Well-Known Member

    Joined:
    Aug 11, 2003
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Toronto, Canada
    HI Digital,

    Thanks for the response!
    Actually, sorry I should have mentioned. I have done that already.
    I also have removed instances of mydomain.com from server2 and still not working.
    It's now even just getting stuck on the server and not going anywhere
     
  4. DigitalN

    DigitalN Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    420
    Likes Received:
    1
    Trophy Points:
    18
    What do the mail logs tell you about the mail deliveries?

    /var/log/exim_mainlog

    Also what does

    # exim -d -bt your@email.com

    show you for the mail routing on server 2?

    have you checked that your dns is ok?

    # dig @localhost MX your_domain.com

    # dig MX your_domain.com

    Need a bit more info - the above should provide more insight :)
     
  5. cyanide

    cyanide Well-Known Member

    Joined:
    Aug 11, 2003
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Toronto, Canada
    HI Digital,
    Thanks again for your reply !

    Okay, I ran # exim -d -bt your@email.com

    And the output
    Code:
    Installing Default Quota Databases......Done
    Quotas are now on
    Updating Quota Files......
    	quotacheck: Cannot get quotafile name for /dev/vzfs
    	quotacheck: Cannot get quotafile name for /dev/vzfs
    	
    
    	quotacheck: Cannot get quotafile name for /dev/vzfs
    	quotacheck: Cannot get quotafile name for /dev/vzfs
    	
    ....Done
    Note: call resetquota with --useplanquotas to reset all quotas to plan defaults
    
    
    name.host-name.com in "lsearch;/etc/userdomains"? no (end of list)
    virtual_user_spam router skipped: domains mismatch
    --------> virtual_user router <--------
    local_part=username domain=name.host-name.com
    checking domains
    search_open: lsearch "/etc/userdomains"
      cached open
    search_find: file="/etc/userdomains"
      key="name.host-name.com" partial=-1 affix=NULL starflags=0
    LRU list:
      :/etc/userdomains
      :/etc/localdomains
      :/etc/valiases/mydomain.com
      :/etc/vdomainaliases/mydomain.com
      End
    internal_search_find: file="/etc/userdomains"
      type=lsearch key="name.host-name.com"
    cached data used for lookup of name.host-name.com
      in /etc/userdomains
    lookup failed
    name.host-name.com in "lsearch;/etc/userdomains"? no (end of list)
    virtual_user router skipped: domains mismatch
    --------> has_alias_but_no_mailbox_discarded_to_prevent_loop router <--------
    local_part=username domain=name.host-name.com
    checking domains
    search_open: lsearch "/etc/localdomains"
      cached open
    search_find: file="/etc/localdomains"
      key="name.host-name.com" partial=-1 affix=NULL starflags=0
    LRU list:
      :/etc/localdomains
      :/etc/userdomains
      :/etc/valiases/mydomain.com
      :/etc/vdomainaliases/mydomain.com
      End
    internal_search_find: file="/etc/localdomains"
      type=lsearch key="name.host-name.com"
    cached data used for lookup of name.host-name.com
      in /etc/localdomains
    lookup yielded:
    name.host-name.com in "lsearch;/etc/localdomains"? yes (matched "lsearch;/etc/localdomains")
    checking "condition"
    has_alias_but_no_mailbox_discarded_to_prevent_loop router skipped: condition failure
    --------> valias_domain_file router <--------
    local_part=username domain=name.host-name.com
    checking require_files
    file check: /etc/vdomainaliases/$domain
    expanded file: /etc/vdomainaliases/name.host-name.com
    stat() yielded -1
    errno = 2
    valias_domain_file router skipped: file check
    --------> virtual_aliases router <--------
    local_part=username domain=name.host-name.com
    checking domains
    search_open: lsearch "/etc/localdomains"
      cached open
    search_find: file="/etc/localdomains"
      key="name.host-name.com" partial=-1 affix=NULL starflags=0
    LRU list:
      :/etc/localdomains
      :/etc/userdomains
      :/etc/valiases/mydomain.com
      :/etc/vdomainaliases/mydomain.com
      End
    internal_search_find: file="/etc/localdomains"
      type=lsearch key="name.host-name.com"
    cached data used for lookup of name.host-name.com
      in /etc/localdomains
    lookup yielded:
    name.host-name.com in "lsearch;/etc/localdomains"? yes (matched "lsearch;/etc/localdomains")
    calling virtual_aliases router
    rda_interpret (string): ${if exists{/etc/valiases/$domain}{${lookup{*}lsearch{/etc/valiases/$domain}}}}
    expanded:
    file is not a filter file
    parse_forward_list:
    virtual_aliases router declined for username@name.host-name.com
    --------> system_aliases router <--------
    local_part=username domain=name.host-name.com
    calling system_aliases router
    rda_interpret (string): ${lookup{$local_part}lsearch{/etc/aliases}}
    search_open: lsearch "/etc/aliases"
    search_find: file="/etc/aliases"
      key="username" partial=-1 affix=NULL starflags=0
    LRU list:
      :/etc/aliases
      :/etc/localdomains
      :/etc/userdomains
      :/etc/valiases/mydomain.com
      :/etc/vdomainaliases/mydomain.com
      End
    internal_search_find: file="/etc/aliases"
      type=lsearch key="username"
    file lookup required for username
      in /etc/aliases
    lookup failed
    expanded:
    file is not a filter file
    parse_forward_list:
    system_aliases router declined for username@name.host-name.com
    --------> local_aliases router <--------
    local_part=username domain=name.host-name.com
    checking for local user
    finduser used cached passwd data for username
    calling local_aliases router
    rda_interpret (string): ${lookup{$local_part}lsearch{/etc/localaliases}}
    search_open: lsearch "/etc/localaliases"
    search_find: file="/etc/localaliases"
      key="username" partial=-1 affix=NULL starflags=0
    LRU list:
      :/etc/localaliases
      :/etc/aliases
      :/etc/localdomains
      :/etc/userdomains
      :/etc/valiases/mydomain.com
      :/etc/vdomainaliases/mydomain.com
      End
    internal_search_find: file="/etc/localaliases"
      type=lsearch key="username"
    file lookup required for username
      in /etc/localaliases
    lookup failed
    expanded:
    file is not a filter file
    parse_forward_list:
    local_aliases router declined for username@name.host-name.com
    --------> userforward router <--------
    local_part=username domain=name.host-name.com
    checking domains
    search_open: lsearch "/etc/userdomains"
      cached open
    search_find: file="/etc/userdomains"
      key="name.host-name.com" partial=-1 affix=NULL starflags=0
    LRU list:
      :/etc/userdomains
      :/etc/localaliases
      :/etc/aliases
      :/etc/localdomains
      :/etc/valiases/mydomain.com
      :/etc/vdomainaliases/mydomain.com
      End
    internal_search_find: file="/etc/userdomains"
      type=lsearch key="name.host-name.com"
    cached data used for lookup of name.host-name.com
      in /etc/userdomains
    lookup failed
    name.host-name.com in "! lsearch;/etc/userdomains"? yes (end of list)
    checking for local user
    finduser used cached passwd data for username
    calling userforward router
    rda_interpret (file): $home/.forward
    expanded: /home/username/.forward
    stat(/home/username/.)=0
    /home/username/.forward does not exist
    userforward router declined for username@name.host-name.com
    --------> localuser_spam router <--------
    local_part=username domain=name.host-name.com
    checking domains
    search_open: lsearch "/etc/userdomains"
      cached open
    search_find: file="/etc/userdomains"
      key="name.host-name.com" partial=-1 affix=NULL starflags=0
    LRU list:
      :/etc/userdomains
      :/etc/localaliases
      :/etc/aliases
      :/etc/localdomains
      :/etc/valiases/mydomain.com
      :/etc/vdomainaliases/mydomain.com
      End
    internal_search_find: file="/etc/userdomains"
      type=lsearch key="name.host-name.com"
    cached data used for lookup of name.host-name.com
      in /etc/userdomains
    lookup failed
    name.host-name.com in "! lsearch;/etc/userdomains"? yes (end of list)
    checking for local user
    finduser used cached passwd data for username
    checking "condition"
    localuser_spam router skipped: condition failure
    --------> localuser router <--------
    local_part=username domain=name.host-name.com
    checking domains
    search_open: lsearch "/etc/userdomains"
      cached open
    search_find: file="/etc/userdomains"
      key="name.host-name.com" partial=-1 affix=NULL starflags=0
    LRU list:
      :/etc/userdomains
      :/etc/localaliases
      :/etc/aliases
      :/etc/localdomains
      :/etc/valiases/mydomain.com
      :/etc/vdomainaliases/mydomain.com
      End
    internal_search_find: file="/etc/userdomains"
      type=lsearch key="name.host-name.com"
    cached data used for lookup of name.host-name.com
      in /etc/userdomains
    lookup failed
    name.host-name.com in "! lsearch;/etc/userdomains"? yes (end of list)
    checking for local user
    finduser used cached passwd data for username
    calling localuser router
    localuser router called for username@name.host-name.com
      domain = name.host-name.com
    set transport local_delivery
    queued for local_delivery transport: local_part = username
    domain = name.host-name.com
      errors_to=NULL
      domain_data=NULL localpart_data=NULL
    routed by localuser router
      envelope to: username@name.host-name.com
      transport: local_delivery
    username@name.host-name.com
        <-- colin@mydomain.com
        <-- colin@mydomain.com
      router = localuser, transport = local_delivery
    search_tidyup called
    hmm, I hadn't thought to look in localdomains
    which shows mydomain.com: username
    I'm wondering if I should replace mydomain.com with the ip address of server1 ?
     
  6. cyanide

    cyanide Well-Known Member

    Joined:
    Aug 11, 2003
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Toronto, Canada
    And, yes I have checked that the dns is fine. In fact I kept modifying it.
    And either I would get domain not found or it would get stuck in mail queu
     
  7. cyanide

    cyanide Well-Known Member

    Joined:
    Aug 11, 2003
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Toronto, Canada
    Hee's the MX dig
    Code:
    dig @localhost MX mydomain.com
    ; <<>> DiG 9.2.4 <<>> @localhost MX mydomain.com
    ;; global options:  printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13431
    ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
    
    ;; QUESTION SECTION:
    ;mydomain.com.                 IN      MX
    
    ;; ANSWER SECTION:
    mydomain.com.          14400   IN      MX      0 mydomain.com.
    
    ;; AUTHORITY SECTION:
    mydomain.com.          14400   IN      NS      ns4.mydomain.com.
    mydomain.com.          14400   IN      NS      ns3.mydomain.com.
    
    ;; ADDITIONAL SECTION:
    ns3.mydomain.com.      14400   IN      A       xx.xx.xxx.x (server2 ip1)
    ns4.mydomain.com.      14400   IN      A       xx.xx.xx.xx (server2 ip2)
    
    ;; Query time: 1 msec
    ;; SERVER: 127.0.0.1#53(localhost)
    ;; WHEN: Mon Jan 31 16:56:11 2005
    ;; MSG SIZE  rcvd: 115
    I guess this is a clue too, that all the dns points to server 2
     
  8. DigitalN

    DigitalN Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    420
    Likes Received:
    1
    Trophy Points:
    18
    You need to remove the domain name from /etc/localdomains

    # grep domain.com /etc/localdomains

    and add it to /etc/remotedomains

    # grep domain.com /etc/remotedomains

    The domain: user - should be in /etc/userdomains.

    Your routers are routing the mail locally, as you know, so you have an issue with that.
    Make the changes until you see the mail is routing remotely, to the intended server.

    If you have issues, then provide your real domain name, that may help to check your dns setup on that server.
     
  9. DigitalN

    DigitalN Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    420
    Likes Received:
    1
    Trophy Points:
    18
    Modify the dns zone on server 2, so that you have the correct IP resolved from the MX record.

    You can do that by adding the correct Ip of server1 as the A record for domain.com or by adding a record such as a mail A record and changing the MX to mail.domain.com.

    Your /etc/resolv.conf shouldn't be resolving requests from 127.0.0.1 , check that and modify if required. dig MX domain.com (rather than @localhost) will show you what you need to know..
     
    #9 DigitalN, Jan 31, 2005
    Last edited: Jan 31, 2005
Loading...

Share This Page