I have a catchall address, but want to block certain addresses that get
nothing but large amounts of spam.
I tried adding the following "verify_only" condition, that checks for a
user file, and then looks in the file to see if the email address is to
be blocked.
The block simply contains two lines:
blocked_email_address_01:1
blocked_email_address_02:1
My code is below, but I must be doing something wrong. I can't figure
out where to negate the match so that if the address is found in the
file through the "lsearch", that the entire condition fails. Thereby
blocking delivery to addresses within the user file.
Any ideas? I'm not exactly sure what I'm doing below, so if can't
figure out what I'm getting at above, maybe you can at least explain my
own code to me, and help me figure out my own problem :)
Thanks,
Terry
block_addresses:
driver = redirect
condition = ${if and {\
{exists{/home/${lookup{$domain}lsearch*{/etc/userdomains}{$value}}/.blockEmails}}\
{\
match\
{${lookup{$local_part}lsearch{/home/${lookup{$domain}lsearch* \
{/etc/userdomains}{$value}}/.catchallEmails}}}\
{\N.*1.*\N}\
}\
}\
}
allow_fail
data = :fail: email address $local_part@$domain was not found.\
Please contact us via a contact form on the website - $domain
verify_only