Email Forwarder to Remote Mail Server Not Working

jodamo5

Registered
Jan 18, 2015
4
0
1
cPanel Access Level
Root Administrator
I have a problem where fowarders are not correctly forwarding emails to a remote mail server. They are instead being delivered to the local server.

Here are the details:
I have two domains in my cPanel account.
  • localmail.com
  • externalmail.com
Both domains have websites on the server.

externalmail.com is using a remote mail exchanger. (It is set correctly in the MX Records section of cPanel to use "remote mail exchanger".)

localmail.com is using the local mail exchanger. But only to forward the emails to the other domain - externalmail.com

So [email protected] forwards to [email protected]

The problem is that the forwarder is trying to deliver [email protected] to a local mailbox on the server.

Firstly, when I had these two domains in the one account, and didn't set up a local mail box for [email protected] then I received an error when setting up the forwarder.
(Warning: “[email protected]” does not refer to a valid local email account or alias. The system will not create a forwarder, because it already sends that email to the default address.)
But if I DO set up a local mailbox on the server for [email protected] then the mail gets delivered to that local inbox - which isn't checked by the domain owner, because that's not where their emails are received.

Finally I removed the localmail.com domain from that cPanel account, and added it to a different cPanel account, but on the same server. It then let me add the forwarder to [email protected] without any problems.

However emails sent to [email protected] gets a "failed delivery" bounce notification because the mailbox doesn't exist. So it still seems to be trying to deliver it locally, instead of honoring the "remote mail exchanger" setting on the externalmail.com domain.

How can we solve this please?

How can I set up an email forwarder to forward [email protected] to [email protected] and have it actually forward to the external mail server?

Thanks
Josh
 

jodamo5

Registered
Jan 18, 2015
4
0
1
cPanel Access Level
Root Administrator
I found the solution, and it seems to be a small bug in cPanel.

For the externalmail.com domain I had set the MX setting to "remote mail exchanger". However there was a single MX record in the table - with priority 0.

This record shouldn't do anything, because the email routing is set to "remote mail exchanger". But this record is doing something. Because when the record was there, the problem behaviour specified above occurred. But once I deleted this MX record, the email forwarding starting working correctly - forwarding to the external mail server.

Proposed fix: If email routing is set to "Remote Mail Exchanger" cPanel should ignore all MX records and always treat the email routing as remote.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,237
463
This record shouldn't do anything, because the email routing is set to "remote mail exchanger". But this record is doing something. Because when the record was there, the problem behaviour specified above occurred. But once I deleted this MX record, the email forwarding starting working correctly - forwarding to the external mail server.
Hello :)

Were you able to manually review the /etc/localdomains and /etc/remotedomains files when this happened to determine which file the domain name existed in?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,237
463
Yes, I checked and the domain was in the /etc/remotedomains file.
To clarify, does it function correctly when the domain name is handled locally through it's addition to the /etc/localdomains file? Thus, the issue is not with the domain name's placement in these files but rather with the configured MX record?

Thank you.