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 Forwarding Behaviour

Discussion in 'E-mail Discussions' started by frenziedfox, Mar 9, 2010.

  1. frenziedfox

    frenziedfox Member

    Joined:
    Mar 9, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    I have a setup like so:

    domainA.com main domain
    domainB.com parked on domainA.com

    I have set domain email forwarding from domainB.com to domainA.com

    On domainA.com I only have the single default mailbox username@domainA.com which isn't used.

    I also have several forwarders e.g. forwardX@domainA.com forwarding to a.nother@externaldomain.com

    both domainA.com and domainB.com are set to discard unrouted email with "unknown user at this address".

    Basically I only want to accept mail for the forwarders forwardX@domainA.com (corresponding with forwardX@domainB.com) All other mail I want to be returned with unknown user error.

    This was working fine until the last couple of days, presumably until an upgrade? Today I noticed that my forwarders had disappeared. When I tried to recreate them I got permission errors on /etc/valiases/domainA.com

    I sorted the permissions and recreated the forwarders, only now this happens:

    If I send an email to forward1@domainA.com the email is correctly forwarded to a.nother@externaldomain.com AND I also get an error "unknown user at this domain"!

    Basically, it picks up and processes the forward ok, but it also sees there isn't a local mailbox for forward1@domainA.com so it sends an error message aswell!!

    The only way I can stop this happening is to forward all unrouted email to the default account username@domainA.com. But this account isn't used, and I don't want wrongly addressed <anything>@domainA.com piling up in there.


    What can I do to get it to behave like it did before?

    thanks,

    Alex
     
    #1 frenziedfox, Mar 9, 2010
    Last edited: Mar 9, 2010
  2. frenziedfox

    frenziedfox Member

    Joined:
    Mar 9, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Having looked at this again, I can put this more succinctly...

    Email to my forwarders (which do not have local accounts) are being considered as being unrouted. They are being forwarded AND being bounced by the catchall fail for the domain.

    Surely if a forwarder exists then email to that forwarder should not also be triggering the "discard unrouted email with error" trap?
     
  3. garrettp

    garrettp Well-Known Member
    PartnerNOC

    Joined:
    Jun 18, 2004
    Messages:
    312
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    DataCenter Provider
    I'd double check to make sure that the catch-all line in /etc/valiases/domain.com is not listed before the actual forwarder alias, e.g.:

    Code:
    *: ":fail: no such user here"
    test@domain.com: test2@asd.com,test@asd.com
    
    I've not tested, but I imagine that case would have both the catch-all and the test@domain.com alias matched.
     
  4. frenziedfox

    frenziedfox Member

    Joined:
    Mar 9, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Thanks, the *: ":fail: no such user here" line is definitely the last line in the file.

    I presume that what is happening is not what is meant to happen then?
     
  5. garrettp

    garrettp Well-Known Member
    PartnerNOC

    Joined:
    Jun 18, 2004
    Messages:
    312
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    DataCenter Provider
    It should indeed be the last line. Perhaps try deleting and re-creating the forwarder?
     
  6. frenziedfox

    frenziedfox Member

    Joined:
    Mar 9, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    I've tried deleting and re-adding the forwarders several times, restarted Exim, reset Exim config file

    I'm running out of ideas. Something caused the forwarders to be deleted originally, so I'm assuming it was an upgrade last night that caused this?

    From exim mainlog

    Code:
    2010-03-09 22:45:25 1Np8B2-0001QQ-Ul <= sender@xxxxx.net H=smarthost03.mail.zen.net.uk [212.23.3.142] P=esmtp S=2886 id=006c01cabfda$3610d910$a2328b30$@net
    2010-03-09 22:45:25 1Np8B2-0001QQ-Ul ** test@domainA.co.uk <test@domainA.co.uk> R=virtual_aliases: No such person at this address
    2010-03-09 22:45:25 1Np8B2-0001QQ-Ul => forward@externaldomain.com <test@domainA.co.uk> R=lookuphost T=remote_smtp H=mail.externaldomain.com [212.240.148.162]
    2010-03-09 22:45:25 1Np8B3-0001QY-UF <= <> R=1Np8B2-0001QQ-Ul U=mailnull P=local S=3810
    2010-03-09 22:45:25 1Np8B2-0001QQ-Ul Completed
    
    So it is looking up test@domainA.com and finding no virtual aliases which triggers "no such person at this address"

    It then goes onto complete the forward

    Should the forwarder be defined as a 'virtual alias' somewhere else in addition to in valiases?
     
  7. frenziedfox

    frenziedfox Member

    Joined:
    Mar 9, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    /scripts/eximup deletes all my forwarders, so there is something not quite right there for a start...
     
  8. frenziedfox

    frenziedfox Member

    Joined:
    Mar 9, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Right... I seem to have sorted this now, however I'm not sure which of the things I did that cured it!

    domainA.com had two entries in /var/cpanel/users/<username>

    Code:
    DNS=domainA.co.uk
    DNS1=domainB.co.uk
    DNS2=domainA.co.uk
    
    This was causing domainA.co.uk to be listed twice in the 'Managing: all domains' drop down box on the 'Set Default Address' page. I removed the DNS2=domainA.co.uk line and then ran /scripts/updateuserdomains (as advised in the comments in /var/cpanel/users/<username>)

    When running /scripts/updateuserdomains I then got a warning that the hostname domainA.com was owned by <username> (strange as this has always been the case and I have run this script before without getting this warning!)

    Checking this, the cpanel system hostname was set as domainA.co.uk (which is obviously owned by <username>)

    I changed the hostname to something else.

    Mail is now only evaluated against one 'router' and testing in the Email Delivery Route page I can see that email now correctly fails or succeeds - not both, as it was doing before!
     
  9. garrettp

    garrettp Well-Known Member
    PartnerNOC

    Joined:
    Jun 18, 2004
    Messages:
    312
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    DataCenter Provider
    I was actually going to ask if your hostname was the same as the domain name in question because cPanel's eximup script actually has a check for this that deletes the valiases file associated with the hostname, which would explain it getting reset when you run that script.
     
Loading...

Share This Page