fixes to correctly trigger Unknown user errors

This commit is contained in:
Matthew Saunders Brown 2025-02-18 15:56:22 -08:00
parent f669ccbe16
commit a1a4ec867e

View File

@ -8,13 +8,12 @@ keep_environment =
add_environment = PATH=/usr/sbin:/usr/bin:/sbin:/bin
smtp_enforce_sync = false
bounce_message_file = /etc/exim4/bounce_message_text
.include /etc/exim4/exim_local.conf
smtp_accept_max = 50
smtp_accept_max_per_host = 10
smtp_accept_queue_per_connection = 50
.include /etc/exim4/exim_local.conf
tls_advertise_hosts = *
tls_certificate = ${if exists{/etc/ssl/letsencrypt/${sg{${tls_sni}}{^smtp\.}{mail.}}.pem}{/etc/ssl/letsencrypt/${sg{${tls_sni}}{^smtp\.}{mail.}}.pem}}
@ -520,7 +519,7 @@ acl_rcpt_to:
# not responding, accept the recipient anyway.
#
deny
message = unknown user
message = Unknown user
domains = +local_domains
!domains = +relay_to_domains
!verify = recipient/callout=no_cache,10s,defer_ok
@ -697,8 +696,6 @@ acl_data:
accept
######################################################################
# ROUTERS CONFIGURATION #
# Specifies how addresses are handled #
@ -762,6 +759,7 @@ srs_forward:
dnslookup:
driver = dnslookup
domains = ! +local_domains
self = pass
transport = remote_smtp
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
@ -966,7 +964,6 @@ system_aliases:
# file_transport = address_file
# pipe_transport = address_pipe
# This router handles forwarding using traditional .forward files in users'
# home directories. If you want it also to allow mail filtering when a forward
# file starts with the string "# Exim filter", uncomment the "allow_filter"
@ -998,7 +995,6 @@ userforward:
pipe_transport = address_pipe
reply_transport = address_reply
# This router matches local user mailboxes.
#localuser:
@ -1006,7 +1002,15 @@ userforward:
# check_local_user
# transport = local_delivery
# This is a clone of the lmtp_localuser, repeated here (last) to trigger "Unknown user".
lmtp_unknown_user:
driver = accept
domains = +local_domains
local_part_suffix = +*
local_part_suffix_optional = true
condition = ${lookup mysql{SELECT vm_mboxes.id FROM vm_mboxes WHERE vm_mboxes.mbox='${quote_mysql:$local_part}' AND vm_mboxes.domain='${quote_mysql:$domain}' AND vm_mboxes.status > '0'}}
transport = dovecot_lmtp
cannot_route_message = Unknown user
######################################################################
# TRANSPORTS CONFIGURATION #