Parked Domain Email Forwarding to User Inbox

GeekPatrolMille

Well-Known Member
Mar 12, 2004
84
0
156
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

[email protected], [email protected], [email protected] should all put mail into the [email protected] 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 [email protected] and it appears in the catchall inbox for mydomain.com because there is no user defined as [email protected] but there is a [email protected] setup.

Any one have a great solution...
Thanks,
-greg
 
Last edited:

GeekPatrolMille

Well-Known Member
Mar 12, 2004
84
0
156
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 = [email protected]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 [email protected] and it was delivered to [email protected] 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
 

GeekPatrolMille

Well-Known Member
Mar 12, 2004
84
0
156
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 = [email protected]

forward_park2.com:
driver = redirect
domains = park2.com
data = [email protected]

forward_park3.com:
driver = redirect
domains = park3.com
data = [email protected]

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
 

cPDan

cPanel Staff
Staff member
Mar 9, 2004
724
15
243
To alias domains in email ([email protected] to goto [email protected]in 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
 

Edward123

Member
Jul 13, 2004
14
0
151
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.
 

cPDan

cPanel Staff
Staff member
Mar 9, 2004
724
15
243
Edward123 said:
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.
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?
 

Edward123

Member
Jul 13, 2004
14
0
151
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.
 

cPDan

cPanel Staff
Staff member
Mar 9, 2004
724
15
243
Edward123 said:
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.
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?
 

goodmove

Well-Known Member
May 12, 2003
643
4
168
cpdan said:
To alias domains in email ([email protected] to goto [email protected]in 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"

.....................
Will this work for add-on domains and email accounts created before the Exim mod?