Re: [exim] What is the easiest way to block email based on b…

Top Page
Delete this message
Reply to this message
Author: jori.hamalainen
Date:  
To: exim-users
Subject: Re: [exim] What is the easiest way to block email based on bodytext?
>> acl_data:
>>    deny message = Your message contains illegal text
>>        condition = ${run{grep -q "illegal text" $spool_directory/input/[how 
>>to get subdir?]/$messageid-D}{yes}{no}}

>>
>> or better ideas?


>Use a MIME ACL (set by smtp_acl_mine) and a mime_regex condition. That way you can also deal with encoded bodies. Or if >that isn't relevent, just an ordinary regex condition.


As I said I am running standard Exim 4.10 which doesn't contain MIME ACL's.

This seems to work almost perfect
deny message = Your message contains illegal text
condition = ${run{/usr/bin/egrep -s 'illegal text' $spool_directory/input/${substr_5_1:$message_id}/$message_id-D}{yes}{no}}

Perhaps should work (as illegal text is within 500 first body characters), to save harddisk IO and resources

deny message = Your message contains illegal text
condition = ${if match{$message_body}{illegal text}{yes}{no}