[Mailman-Users] ban_list example?

Richard Barrett r.barrett at openinfo.co.uk
Mon Oct 13 21:32:25 CEST 2003

On Monday, October 13, 2003, at 07:51  pm, Skip Montanaro wrote:

>>> Try
>>> ^.*@xyz.com
>     Scott> Not knowing anything about mailman's use of these values:
>     Scott> The "^.*something" regex is equivalent to just "something".
>     Scott> "^.*" is useless, confusing and should never be used in a 
> regex
>     Scott> for the regex libraries with which I am familiar.
> I realized it was superfluous shortly after posting.  I was focusing 
> on the
> missing '.' (really, just about anything) in the OP's post.  "@xyz.com"
> should be sufficient, unless Mailman uses re.match() for this 
> particular

The ban_list check uses regex and re.search iff the first char is ^ BUT 
the ^ is not removed so regex matching is always effectively anchored 
at the start of the string because it is always a single line.

So you have to match for the local-part before matching for the domain 
even if .* is acceptable.

Without the leading ^ the ban_list comparison done is a simple string 
equality test with no wildcards or such; that's what regular 
expressions are for.

> task.
> -- 
> Skip Montanaro
> Got gigs? http://www.musi-cal.com/
>           http://www.mojam.com/
> Got spam? http://spambayes.sf.net/
Richard Barrett                               http://www.openinfo.co.uk

More information about the Mailman-Users mailing list