Q0413 - Exim/exim GitHub Wiki
Q0413
When a user's .forward file is syntactially invalid, Exim defers delivery of all messages to that user, which sometimes include the user's own test messages. Can it be told to ignore the .forward file and/or inform the user of the error?
Setting skip_syntax_errors
on the redirect router causes syntax errors
to be skipped. When dealing with users' .forward files it is best to
combine this with a setting of syntax_errors_to
in order to send a
message about the error to the user. However, to avoid an infinite
cascade of messages, you have to be able to send to an address that
bypasses .forward file processing. This can be done by including a
router like this one
real_localuser:
driver = accept
check_local_user
transport = local_delivery
local_part_prefix = real-
before the redirect router that handles .forward files. This will
do an ordinary local delivery without .forward processing, if the
local part is prefixed by real-
. You can then set something like the
following options on the redirect router:
skip_syntax_errors
syntax_errors_to = real-$local_part@$domain
syntax_errors_text = "\
This is an automatically generated message. An error has been \
found\nin your .forward file. Details of the error are reported \
below. While\nthis error persists, messages addressed to you will \
get delivered into\nyour normal mailbox and you will receive a \
copy of this message for\neach one."
A final tidying setting to go with this is a rewriting rule that changes
real-username
into just username
in the headers of the message:
\N^real-([^@]+)@your\.dom\.ain$\N [email protected] h
This means that users won't ever see the real-
prefix, unless they
look at the Envelope-To: header.