Re: Untaint $local_part, $domain and other variables

Emilio Augusto Lazo Zaia via Exim-users <[email protected]>
Newsgroups gmane.mail.exim.user
Message-ID <[email protected]>
On 9/14/25 13:42, Jeremy Harris via Exim-users wrote:

> On 2025/09/14 6:09 PM, Emilio Augusto Lazo Zaia via Exim-users wrote:
>> I'm trying to implement a mechanism to notify a local recipient when a message addressed to them is denied by an ACL rule
>
> If a message has been denied, how will this transport be run?
>
> I think you have more issues than those arguments.

I did not explain sufficiently.

on check_rcpt_acl:

warn
     spf = fail
     condition = ${if match_domain{$domain}{+local_domains}{yes}{no}}
     set acl_m2 = spf_fail_notify

accept
     condition = ${if eq{$acl_m2}{spf_fail_notify}{yes}{no}}
     log_message = SPF FAIL - Notifying recipient $local_part@$domain

Router:

spf_fail:
     driver = accept
     condition = ${if eq{$acl_m2}{spf_fail_notify}{yes}{no}}
     transport = spf_fail_notif
     no_more

Actually, the email would not be "denied" by an ACL as I mentioned. Instead, it will only be tagged with the variable acl_m2 and then processed on transport through the script. This script will then discard the message and write a warning to the user (or write to a file to take other actions, such as notifying them once a day).

My only concern is with all the variables the transport must send to the script as arguments, since Exim refuses to use them because they are all *tainted*."


-- 
Emilio Augusto Lazo Zaia


-- 
Emilio Augusto Lazo Zaia

-- 
## subscription configuration (requires account):
##   https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
##   [email protected]
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.