Root forward to locally forwarded email "user doesn't exist" despite forward working

poppyq

Well-Known Member
Jul 15, 2003
54
0
156
Portland, OR
cPanel Access Level
Root Administrator
So, this is kind of a weird one. I've been forwarding all root email to [email protected] for a domain and email hosted on the local server. However, instead of having an email account for [email protected], I've been using a mail forward from [email protected] to [email protected]. This has been working for a very long time, until last week.

Suddenly, I've started getting mail delivery failed emails from the server with "[email protected] user doesn't exist". What's weird about this is that I'm actually still getting the forwards at [email protected]. Somehow, it seems to be trying to both forward the email and send it to a local mailbox that doesn't exist, using the same email address.

I'm not sure how to fix this. Temporarily I've set the root forward directly to [email protected] (I know). I've looked through domain aliases, dns settings/zones (dns is hosted externally), deleted and recreated the forward, etc., but can't find anything specific to why this might be happening. Possible bug when using a root forward to a locally hosted/forwarded email in a recent update?
 

swipesy

Registered
Jun 25, 2002
1
2
153
I had the same problem, which took me several hours to find the cause. I literally just found it and fixed it minutes ago.

Without going into all the details, it came down to this line in exim.conf:

require_files = "+/etc/valiases/$domain:+${extract{5}{::}{${lookup passwd{${lookup{$domain}lsearch{/etc/userdomains}{$value}}}{$value}}}}/mail/$domain/$local_part"

dovecot_virtual_delivery will trigger a local delivery if the mail *folder* exists, whether or not the email account record does. Using the [email protected] example (CPanel user "domain"), see if this folder exists:

/home/domain/mail/domain.com/user

If it does, that's the reason exim is trying to deliver the message there. Delete the "user" folder and the problem should go away.

I don't know for sure, but I believe this started happening for me when courier was replaced with dovecot by CPanel.

Hope that helps!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,211
363
Hello,

Could you verify if the hostname is missing from the /etc/localdomains file on the affected systems? If so, adding the server's hostname to this file should address the issue.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,211
363
To update, an unnecessary directory likely existed for the affected email account at the following location:

/home/$cpanel-username/mail/$domain.com/$email-username/

The existence of such a directory can result in "User doesn't exist" error messages if no corresponding email account exists on the system. Manually creating an email account for the affected user or removing the offending directory are both effective workarounds.

Thank you.
 

poppyq

Well-Known Member
Jul 15, 2003
54
0
156
Portland, OR
cPanel Access Level
Root Administrator
I had the same problem, which took me several hours to find the cause. I literally just found it and fixed it minutes ago.

Without going into all the details, it came down to this line in exim.conf:

require_files = "+/etc/valiases/$domain:+${extract{5}{::}{${lookup passwd{${lookup{$domain}lsearch{/etc/userdomains}{$value}}}{$value}}}}/mail/$domain/$local_part"

dovecot_virtual_delivery will trigger a local delivery if the mail *folder* exists, whether or not the email account record does. Using the [email protected] example (CPanel user "domain"), see if this folder exists:

/home/domain/mail/domain.com/user

If it does, that's the reason exim is trying to deliver the message there. Delete the "user" folder and the problem should go away.

I don't know for sure, but I believe this started happening for me when courier was replaced with dovecot by CPanel.

Hope that helps!
Sorry it took me so long to respond to this, but this was exactly what it was. Thank you so much! The weird part is that I've been using a forward for at least a year, and this only started happening in the past couple of months. I'm not sure how to explain that, but it doesn't matter anymore as it's been fixed. Also thanks to cPanelMichael as he suggested the same thing as well.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,211
363