Re: [exim] Regex String Help - Spam Filter Trick

Pàgina inicial
Delete this message
Reply to this message
Autor: Marc Perkel
Data:  
A: exim
Assumptes vells: Re: [exim] Regex String Help
Assumpte: Re: [exim] Regex String Help - Spam Filter Trick
OK - that seems to work. David - you are brilliant!!!!

Here's the working filter:

headers add "X-Sender-Nameserver: \
${sg{${sg{\
${sg{ \
${lookup dnsdb{zns=${sg{$sender_host_address}\
{\\N([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\N}\
{\\N$4.$3.$2.$1.in-addr.arpa\\N}}}} \
${lookup dnsdb{zns=${sg{$sender_host_address} \
{\\N([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\N}\
{\\N$3.$2.$1.in-addr.arpa\\N}}}} \
${lookup dnsdb{mxh=$sender_address_domain : ${domain:$h_From:} :
$sender_helo_name}} \
}{\\n}{ }}\
}{\\N\\s(.*?)(?=\\s(.*\\s)?\\1\\s)\\N}{}}}{\\N^\\s|\\s(?=\\s)|\\s$\\N}{}}"

For any of you who are wondering what all this does - I'm gathering up a
bunch of information about DNS relating to the message and adding it in
a header. I then run it through spam assassin and this extra information
gives the bayesian filter more facts to chew on. I then remove the
header coming out of the filter. The more info you feed bayes - the
better it works.


David S. Madole wrote:

> From: "Marc Perkel" <marc@???>
>
> # cat test
> #Exim Filter
>
> testprint "${sg{192x168x231x193}\
> {\\N([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3}\)\.([0-9]{1,3}\)\\N}\
> {\\N$4.$3.$2.$1.in-addr.arpa\\N}}"
>
> # exim -bf test < /dev/null
> Testprint: 193.231.168.192.in-addr.arpa
>
> David
>
>