[Mailman-Users] OT - Regex help (was: Re: About Spam Filtering

Tanstaafl tanstaafl at libertytrek.org
Sat Feb 16 14:08:50 CET 2013


On 2013-02-15 10:25 AM, Joseph Brennan <brennan at columbia.edu> wrote:
>
> elsif
> (/^from:.*+(bounce|do-not-reply|facebook|linkedin|list-|myspace|twitter)/i)
> { $logger->debug("Multi-string From header matching $1: $2 found;
> exiting"); exit (0); }
>
>
> Examine the logic of the 'if' and any 'elsif' above this line.
>
> I am uncertain what /.*+/ would do. Remove either * or +.

Thanks for the help Joseph (and Stephen)...

This 'if' block is just a bunch of separate one line tests that, if any 
of them match, result in the vacation response not being sent, so it 
doesn't really matter what is above them (they are all the defaults, 
this is the only line I am modifying)...

This line should simply examine any from header, and if any of the 
included strings are found *anywhere* in the from address, local or 
domain part, so, either side of the '@' sign, and regardless of any dots 
anywhere in the string.

I imagine that is why the guys from postfixadmin used the * and maybe 
the +? Like I said, I've got no experience with regex at all - guess its 
time to learn eh? ;)

Anyway, I want the regex such that any/all of the following from 
addresses would match (along with all of the other strings):

bounce-anything at example.com
anything at bounce.example.com
anything at bounce-reply.example.com
facebook at example.com
anything.facebook at example.com
anything-facebook at example.com
anything at something.facebook.com

Hopefully that is enough examples...

Basically, if *any* of the strings I might specify inside the 
parenthesis match individually anywhere in the from address, then don't 
send the response (ie, positive match).

Thanks again, it is really appreciated...


More information about the Mailman-Users mailing list