This problem apparently began occurring after I setup DKIM/SPF/DMARC for all of my domains in July 2018, but it has gone unnoticed until today. When I send an email from a remote server to a virtual email address on my server, there are no issues. However, if I send an email to a domain owner's DirectAdmin-assigned email account, for example '[email protected]' where the email/DirectAdmin login would simply be 'domainowner', the email fails to find its way to where it needs to be. The corresponding entries from the mainlog are as follows:
In this instance, an email would've been sent to '[email protected]', where 'domainowner' is the user who owns 'example.com', and it's correctly reflected as such in /etc/virtual/domainowners. I've checked /etc/virtual/domainowners to be sure that it contains all of the domains present on the server, and it looks just as it should, and also has the correct permissions (0644 mail:mail). I also checked /etc/virtual/domains, and it looks fine as well. Looking at the aforementioned entries of the mainlog, this part is what bothers me:
I'm wondering if there's something wrong with the domain_filter router in my exim.conf, some other part of the exim.conf, or maybe even something else completely. The only parts of the exim.conf file (according to a diff from the current one and a backup from June 2017) that were changed at some point are the following (I'm not sure which of these were changed when I setup DKIM/SPF/DMARC):
Any help figuring this out would be greatly appreciated.
Code:
2019-01-18 05:44:24 1gkMx6-0004Rr-EI DKIM: d=gmail.com s=20161025 c=relaxed/relaxed a=rsa-sha256 b=2048 [verification succeeded]
2019-01-18 05:44:24 1gkMx6-0004Rr-EI <= [email protected] H=mail-wr1-f51.google.com [209.85.221.51] P=esmtps X=TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128 CV=no S=2757 id=CAD_03fyEYgHBQEfrrTwcWA11gDkStqVyGHUe06YtLfrGNcrpnw@mail.gmail.com T="Are you getting emails?" from <[email protected]> for [email protected]
2019-01-18 05:44:24 1gkMx6-0004Rr-EI Failed to find user "" from expanded string "${lookup{$domain}lsearch{/etc/virtual/domainowners}{$value}}" for the domain_filter router
2019-01-18 05:44:24 1gkMx6-0004Rr-EI == [email protected] <[email protected]> R=domain_filter defer (-1): Failed to find user "" from expanded string "${lookup{$domain}lsearch{/etc/virtual/domainowners}{$value}}" for the domain_filter router
2019-01-18 05:44:24 1gkMx6-0004Rr-EI Failed to find user "" from expanded string "${lookup{$domain}lsearch{/etc/virtual/domainowners}{$value}}" for the domain_filter router
2019-01-18 05:44:24 1gkMx6-0004Rr-EI == [email protected] <[email protected]> R=domain_filter defer (-1): Failed to find user "" from expanded string "${lookup{$domain}lsearch{/etc/virtual/domainowners}{$value}}" for the domain_filter router
2019-01-18 05:44:24 1gkMx6-0004Rr-EI ** [email protected] <[email protected]>: retry timeout exceeded
2019-01-18 05:44:24 1gkMx6-0004Rr-EI ** [email protected] <[email protected]>: retry timeout exceeded
2019-01-18 05:44:24 1gkMx6-0004Rv-JV <= <> R=1gkMx6-0004Rr-EI U=mail P=local S=4339 T="Mail delivery failed: returning message to sender" from <> for [email protected]
2019-01-18 05:44:24 1gkMx6-0004Rr-EI Completed
2019-01-18 05:44:25 1gkMx6-0004Rv-JV H=gmail-smtp-in.l.google.com [2a00:1450:4010:c0a::1b] No route to host
2019-01-18 05:44:26 1gkMx6-0004Rv-JV => [email protected] F=<> R=lookuphost T=remote_smtp S=4444 H=gmail-smtp-in.l.google.com [173.194.221.26] X=TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128 CV=yes C="250 2.0.0 OK 1547791018 t6-v6si3529492lje.173 - gsmtp"
2019-01-18 05:44:26 1gkMx6-0004Rv-JV Completed
In this instance, an email would've been sent to '[email protected]', where 'domainowner' is the user who owns 'example.com', and it's correctly reflected as such in /etc/virtual/domainowners. I've checked /etc/virtual/domainowners to be sure that it contains all of the domains present on the server, and it looks just as it should, and also has the correct permissions (0644 mail:mail). I also checked /etc/virtual/domains, and it looks fine as well. Looking at the aforementioned entries of the mainlog, this part is what bothers me:
Code:
Failed to find user "" from expanded string "${lookup{$domain}lsearch{/etc/virtual/domainowners}{$value}}" for the domain_filter router
I'm wondering if there's something wrong with the domain_filter router in my exim.conf, some other part of the exim.conf, or maybe even something else completely. The only parts of the exim.conf file (according to a diff from the current one and a backup from June 2017) that were changed at some point are the following (I'm not sure which of these were changed when I setup DKIM/SPF/DMARC):
Code:
#.include_if_exists /etc/exim.spamassassin.conf
CHANGED TO:
.include_if_exists /etc/exim.spamassassin.conf
Code:
domain_filter:
driver = redirect
allow_filter
no_check_local_user
condition = "${if exists{/etc/virtual/${domain}/filter}{yes}{no}}"
user = "mail"
file = /etc/virtual/${domain}/filter
file_transport = address_file
pipe_transport = virtual_address_pipe
retry_use_local_part
no_verify
CHANGED TO:
domain_filter:
driver = redirect
allow_filter
no_check_local_user
condition = "${if exists{/etc/virtual/${domain}/filter}{yes}{no}}"
user = "${lookup{$domain}lsearch{/etc/virtual/domainowners}{$value}}"
group = "mail"
file = /etc/virtual/${domain}/filter
directory_transport = address_file
pipe_transport = virtual_address_pipe
retry_use_local_part
no_verify
Code:
local_delivery:
driver = appendfile
delivery_date_add
envelope_to_add
file = /var/mail/$local_part
group = mail
mode = 0660
return_path_add
user = ${local_part}
CHANGED TO:
local_delivery:
driver = appendfile
delivery_date_add
envelope_to_add
directory = /home/$local_part/Maildir/
directory_mode = 770
create_directory = true
maildir_format
group = mail
mode = 0660
return_path_add
user = ${local_part}
Code:
virtual_localdelivery:
driver = appendfile
create_directory
delivery_date_add
directory_mode = 700
envelope_to_add
file = /var/spool/virtual/${domain}/${local_part}
group = mail
mode = 660
return_path_add
user = "${lookup{$domain}lsearch*{/etc/virtual/domainowners}{$value}}"
quota = ${if exists{/etc/virtual/${domain}/quota}{${lookup{$local_part}lsearch*{/etc/virtual/${domain}/quota}{$value}{0}}}{0}}
CHANGED TO:
virtual_localdelivery:
driver = appendfile
create_directory
delivery_date_add
directory_mode = 770
envelope_to_add
directory = /home/${lookup{$domain}lsearch*{/etc/virtual/domainowners}{$value}}/imap/${domain}/${local_part}/Maildir
maildir_format
group = mail
mode = 660
return_path_add
user = "${lookup{$domain}lsearch*{/etc/virtual/domainowners}{$value}}"
quota = ${if exists{/etc/virtual/${domain}/quota}{${lookup{$local_part}lsearch*{/etc/virtual/${domain}/quota}{$value}{0}}}{0}}
Code:
remote_smtp:
driver = smtp
CHANGED TO:
remote_smtp:
driver = smtp
.include_if_exists /etc/exim.dkim.conf
Any help figuring this out would be greatly appreciated.