Is it safe to have 2 domains forwarding all email to each other?

jandafields

Well-Known Member
May 6, 2004
443
6
168
USA
cPanel Access Level
Root Administrator
Email Domain Forwarder #1:
example1.com -> example2.com

Email Domain Forwarder #2:
example2.com -> example1.com

Is there any chances of getting into an infinite loop? The documentation says the forwarder is only triggered if the email is undeliverable, which makes sense. But what happens if the email is undeliverable to both domains? Will it simply stop? Or will it forward in a circle forever?
 

jandafields

Well-Known Member
May 6, 2004
443
6
168
USA
cPanel Access Level
Root Administrator
I want to create a 2nd domain and allow anyone to email either one regardless of which one contains the email account:

Assume I have my main domain example1.com, and the email [email protected]

So, I want to change to / add example2.com but I don't want to suddenly change everyone's username, so I create an email domain forwarder example2.com -> example1.com

Doing that, when someone emails bob at either [email protected] or [email protected], they both end up at [email protected]

Good.

However, now suppose I create a new email [email protected]. Someone might try to email alice with [email protected]. So, I would do the same thing as before, I would create an email domain forwarder example1.com -> example2.com

Doing that, when someone emails alice at either [email protected] or [email protected], they both end up at [email protected]

Good.

I believe that would work as intended, because the email domain forwarders only get triggered if email is undeliverable. So it should work in both directions now for email addresses that exist in either domain.

However, I'm concerned about someone emailing [email protected] or [email protected]. Since that doesn't exist at either domain, it will trigger the domain email forwarder. Then, it still won't exist at the opposite one, so it might trigger the domain forwarder again, creating a loop. I know that exim/cpanel does a few things to prevent loops like that from happening, but I'm not sure about this particular case specifically.

I realize I could create individual forwards for each email address, but the domain forwarder is specifically created for the very purpose of avoiding doing that.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,505
2,605
363
cPanel Access Level
Root Administrator
Thanks for the additional details. You'll just want to ensure that the domain forwarder is setup to go from example1 to example2, and then ensure the users are checking email for example2. You don't want to have any forwarders setup on the example2 domain itself.
 

jandafields

Well-Known Member
May 6, 2004
443
6
168
USA
cPanel Access Level
Root Administrator
I want email accounts on both domains, but I want to be able to email either domain and it arrive in the correct place.

You have not yet answered the question: Will this definitely create an infinite loop? Or is cpanel/exim smart enough to stop processing it before looping?