[milters] Archive

Lists Index Date Thread Search

Article: 668
From: Anthony Howe
Date: 2005-07-28 01:31:41 -0400
Subject: Re: White list pattern matching...

Removal...........: milters-request@milter.info?subject=remove
More information..: http://www.milter.info/#Support
--------------------------------------------------------

Grant Taylor wrote:
> is different per message and recipient.  However all the sender 
> addresses seem to be made up of "sender-<a series of numbers and 
> dashes>-<recipient user part>=<recipient domain part>@<sender
domain 
> part>".  I would like to be able to have something similar to 
> "milter-date-From:<recipient user part>=<recipient domain
part>@<sender 
> domain part>   OK".  I know that I could match based on the entire 
> sender address but I'm not sure if I can match on part of it or not.

Using key/value pairs there is no way to specify any form of wildcard 
matching in the key. Its simply not possible to derive a key to lookup 
with from the email address. You need to know the patterns before the 
keys can be generated.

Two possible methods:

a) Create a separate file containing a list of regex/value to test. 
Means restarting the milter when this file changes to reload patterns 
into memory. I dislike this solution for some reason that escapes me now.

b) More of a kludge, but keeps everything central in access.db. I have 
considered a special lookup something like, where the right hand side 
would be handled specially:

milter-NAME-from:domain.com	
	/pattern/action /pattern/action ... [default-action]

or maybe

milter-NAME-TAG:sender@
	/pattern/action /pattern/action ... [default-action]

For example:

milter-sender-from:yahoogroups.com	
	/goof-[0-9]+-ball@/REJECT  /tosser-[a-z0-9]+-user@/REJECT OK

milter-sender-connect:192.168		/.0.[0-9]+$/OK REJECT

Essentially I could implement some form of wildcard matching (either 
regex or simple glob-like) by selecting a pattern set based on one of 
the existing key lookups for address-local-part, address-domain, 
client-ip, client-domain.

The actual syntax I've not really considereded in depth, but it has been 
a rough idea I've been toying with. However, there would be a 
performance overhead in doing this and one of the reasons I've put the 
idea off.

-- 
Anthony C Howe                                 +33 6 11 89 73 78
http://www.snert.com/       ICQ:
7116561         AIM: Sir Wumpus

Sendmail Anti-Spam Solutions           http://www.snertsoft.com/
                                             We Serve Your Server

Lists Index Date Thread Search