Problems setting up email forwarders in exim

shaqabwebmaster

Registered
Jun 27, 2018
3
0
1
Qatar
cPanel Access Level
Root Administrator
I've manually tried adding and removing some entries in /etc/valiases/<domain> files in the system as root to configure mail forwarding but unfortunately, some forwarding which I manually removed and added are not taking effect. It looks like a cache or certain copy of the old forwarders still exist. I restarted all services and even cleared exim cache but still not luck.

I bumped into a solution about recreating the /etc/aliases.db but I am not sure if exim is using this file. I've also tried the ff commands but no luck:

exim_dbmbuild /etc/aliases /etc/aliases.db
exim_dbmbuild /etc/valiases/<domain> /etc/aliases.db

Some guys from the forums mentioned that we have to run newaliases command as root in the terminal to rebuild /etc/aliases.db but it looks like this is for Sendmail MTP and not for exim. Anyone can help me understand how to update mail forwarders?

Btw, I've also used the CPANEL interface for this but it looks like the same thing is happening.
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,304
363
Houston

shaqabwebmaster

Registered
Jun 27, 2018
3
0
1
Qatar
cPanel Access Level
Root Administrator
Hi Lauren, as mentioned in my post, any changes I've made in the email forwarders for some account does not apply properly. May it be a change from the Cpanel interface or manually editing the /etc/valiases/<domain> files.

To give an example:

I have an existing forwarder:

[email protected]: [email protected]

Then, I deleted this forwarder and created a new one.

[email protected]: [email protected]

After making these changes, whenever somebody sends an email to [email protected], the email is still being forwarded to [email protected] every time. The email is also not being forwarded to [email protected] as if the forwarder is not there.

Please note that I already cleared exim cache, restarted exim and other services and even waited for days just to see if these changes require propagation time but it looks like this problem still persist. I even removed all forwarders for [email protected] but still email are still being forwarded to [email protected].

That's why I thought that there might be some cache or copy somewhere else of the previous forwarder.

Creating a new forwarder that doesn't exist before works fine:

If [email protected] doesn't have any existing forwarder, creating a new one will work fine. Removing and deleting existing forwarders for user2@domain also works fine. That's why I mentioned that this is only happening to "some" users and not to all.
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,304
363
Houston
Hi @shaqabwebmaster


Thanks for explaining the issue! The only reason I noted the supported method of modifying the forwarders is because of this statement:

I've manually tried adding and removing some entries in /etc/valiases/<domain> files in the system as root to configure mail forwarding but unfortunately, some forwarding which I manually removed and added are not taking effect. It looks like a cache or certain copy of the old forwarders still exist. I restarted all services and even cleared exim cache but still not luck.
I just want it to be clear this shouldn't be necessary.


Can you run the following I'm curious to see if the old forwarder is present in any of the other valiases files:

Code:
grep -ir "[email protected]" /etc/valiases