Relaying email to old mail server

molecool

Registered
Jan 22, 2011
1
0
51
I have a domain that is currently hosted on my old server. I'm in the process of switching to a new server and this is what I want to do:

- Capture all email traffic here at the new server and deliver it to each respective mailbox.
- After that I want to also *relay all emails on to my old email IP* so that it collects and routes mail to mailboxes there as it does right now.

The last point is the important one. I just looked at the mail forwarder in Cpanel and all it's doing is to forward emails from one domain to another. For example:

[email protected]> [email protected]

That is NOT what I'm looking for. What I need is this:

[email protected] (running on new IP as mapped by MX entries) ----> [email protected] (on old IP running outside the network)

In essence, the old email server runs as a shadow of the new email server. Does this make sense and how is it done?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
38
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Hello,

You cannot route emails to two locations for the same domain with two different IPs. The better way to do it would be to setup oldmail.foo.com and have emails forward to oldmail.foo.com as a subdomain on foo.com

The way email works, MX records can be different fully qualified domain names or route to a select IP, but they only route once for that domain until they reach a destination. Even secondary and tertiary MX records only hold emails temporarily until the primary MX record is back up and then route to the primary in that event.

As such, you can add a subdomain for the old domain to receive emails for those accounts (and then route from the subdomain once they are delivered to the old server locally to the other domain).

Otherwise, a better approach is likely to just rsync the email data, since you don't have to use email to copy them over to the old server. Rsync and scp are both copying methods to copy data from one server to another. Using rsync or scp, you could simply copy the data from the one machine to the other periodically via a cron.

Thanks.