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.

Parked Domain Email Forwarding to User Inbox

Discussion in 'E-mail Discussions' started by GeekPatrolMille, Sep 3, 2004.

  1. GeekPatrolMille

    GeekPatrolMille Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    McKinney, Texas, USA
    Parked Domain Email Forwarding to User Inbox - Potential Solution

    I have 10 domains which are currently set up as parked domains under mydomain.com

    Is there a way to set up a user to receive email from all of the parked domains to the common inbox at mydomain.com

    Example:

    park1.com
    park2.com
    etc... all parked domains

    mydomain.com is the primary domain

    greg@park1.com, greg@park2.com, greg@... should all put mail into the greg@mydomain.com inbox. At least this is the desired effect. I am trying to do this for 100+ users and 10 domains so creating forwards and aliases is not how I would like to see this work.

    I have sent an email to greg@park1.com and it appears in the catchall inbox for mydomain.com because there is no user defined as greg@park1.com but there is a greg@mydomain.com setup.

    Any one have a great solution...
    Thanks,
    -greg
     
    #1 GeekPatrolMille, Sep 3, 2004
    Last edited: Sep 3, 2004
  2. GeekPatrolMille

    GeekPatrolMille Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    McKinney, Texas, USA
    OK, after posting the previous mesaage I adjusted how I was searching and found this question to be a biggie and for a long time...

    I have found a quick and easy work-around which can be applied from WHM.

    From the Main Manager Screen
    Service Configuration
    Exim Configuration Editor
    Click on (EXIM) Edit Raw Config File

    This allows you to edit the EXIM server config file. PLEASE BE VERY CAREFULL. You can really muck things up if you do not understand what this is and what you are about to do... If you feel confident your server is going to work no matter what you do... STOP NOW... If you know that this may ruin you whole day, week, month, year, life, etc... CONTINUE...

    Scroll down to the configuration area:
    ######################################################################
    # ROUTERS CONFIGURATION #
    # Specifies how remote addresses are handled #
    ######################################################################
    # ORDER DOES MATTER #
    # A remote address is passed to each in turn until it is accepted. #
    ######################################################################

    Here you will find two text fields which you can add your own configuration commands. I used the second text field at the end of this section and just above the DIRECTORS CONFIGURATION section.

    In this text field I entered the following:

    forwarddomain:
    driver = redirect
    domains = parkeddomain.com
    data = $local_part@primarydomain.com

    I then clicked the SAVE button way down at the bottom of this page. Be aware, the save button will cause your EXIM to RESTART, right then, no warnings. (I only got one angry call <grin> Your results may vary.) If you do not know how long it takes your EXIM to restart, it would be best to do this during a very low usage time. Check you WHM Mail Stats page for a good time.

    After everything came back up, I was able to send an email to greg@parkeddomain.com and it was delivered to greg@primarydomain.com with no problem. I am going to apply this to a handfull of the domains tonight and test some more. I will report back on the results.

    Scared Scriptless :eek:
    Gregory Miller
    AGBSM Networks
     
  3. GeekPatrolMille

    GeekPatrolMille Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    McKinney, Texas, USA
    Ok, Final note and test results...

    It is not necessary to have the domain parked for this solution to work which adds the benfit of having two completely different web sites on different domains but allowing all the mail to funnel to a single common email address. This method also works if the domain is parked (just to be clear).

    In my case I have 10 domains park1.com, park2.com, park3.com, etc... I added this to the routers configuration setup as described above...

    forward_park1.com:
    driver = redirect
    domains = park1.com
    data = $local_part@mydomain.com

    forward_park2.com:
    driver = redirect
    domains = park2.com
    data = $local_part@mydomain.com

    forward_park3.com:
    driver = redirect
    domains = park3.com
    data = $local_part@mydomain.com

    etc...

    There may be a way to combine all of this goodness into a single group of commands but I took the safe route. The safe route always requires extra typing. Better safe than sorry.

    Please, if anyone has additional input, add it in. I know this has been a big issue and I have not seen any other simple fixes posted.

    Good Luck,
    -greg
    :D
     
  4. cPDan

    cPDan cPanel Staff
    Staff Member

    Joined:
    Mar 9, 2004
    Messages:
    711
    Likes Received:
    3
    Trophy Points:
    18
    To alias domains in email (whatever@parked.domain to goto whatever@main.domain instead of the default address), and do it autmatically when you create an email account for main.domain, do this:

    put this in /etc/exim.conf right under "begin router"

    Code:
    alias_domain_file:
        driver = redirect
        domains = lsearch;/etc/aliasdomains
        data = ${quote_local_part:$local_part}@${lookup {$domain} lsearch {/etc/aliasdomains}}
    
    then in /etc/aliasdomains add these entries foreach aliased domain you want:

    Code:
    parked.domain: main.domain
    parked2.domain: main.domain
    parked3.domain: main2.domain
    
     
  5. Edward123

    Edward123 Member

    Joined:
    Jul 13, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    I tried the above method(s) - exim would not restart.

    On my attempt to use the method posted by cpdan I did find this bit in the restart failure output:

    exim: router alias_domain_file: cannot find router driver "redirect" in line [nnn]

    Am I missing a driver?

    Thanks for your help.
     
  6. cPDan

    cPDan cPanel Staff
    Staff Member

    Joined:
    Mar 9, 2004
    Messages:
    711
    Likes Received:
    3
    Trophy Points:
    18
    That's odd because if I do
    cat /etc/exim.conf |grep redirect
    I see "driver = redirect"
    8 or 9 times

    Your's doesn't have those?
     
  7. Edward123

    Edward123 Member

    Joined:
    Jul 13, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Doesn't have 'em. The only place the word "redirect" appears in my exim.conf file is as part of a comment that runs from approx lines 107-112, where it says:

    "...# normal user. This isn't usually a problem, as most sites have an alias for
    # root that redirects such mail to a human administrator."

    I can put a copy of the file someplace (or e-mail it to you) if you would like to check it out.

    I appreciate for your help.
     
  8. cPDan

    cPDan cPanel Staff
    Staff Member

    Joined:
    Mar 9, 2004
    Messages:
    711
    Likes Received:
    3
    Trophy Points:
    18
    Hmm, doesn't sound like a cPanel exim installation because many of the routers in the cPanel installed exim's /etc/exim.conf use the redirect driver.

    What does
    exim -bV
    output?
     
  9. Edward123

    Edward123 Member

    Joined:
    Jul 13, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    output:

    Exim version 3.36 #1 built 21-April-2003 16:20:04
     
    #9 Edward123, Sep 17, 2004
    Last edited: Sep 17, 2004
  10. goodmove

    goodmove Well-Known Member

    Joined:
    May 12, 2003
    Messages:
    624
    Likes Received:
    0
    Trophy Points:
    16
    Will this work for add-on domains and email accounts created before the Exim mod?
     
Loading...

Share This Page