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

2013-02-16 Thread Tanstaafl

On 2013-02-16 9:54 AM, Joseph Brennan  wrote:

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)...


Not exactly. If you chain them with elsif then the conditions are tested
in order until one matches, and any after that are not tested. If one of
the earlier conditions matched then your rule would never match.


Correct... what I meant was, if one of the prior tests match, then the 
vacation message will NOT be sent, so my test is irrelevant, since it 
only has the potential to do the same thing (prevent the message from 
being generated).


None of these tests are used to send the message, only prevent it from 
being sent...



Remove the + mark (and learn what .* means) and you're probably done.


Done... hopefully this will fix things up... thanks again!


In the debug statement, $1 will be the string in ( ) that matched, but
$2 is not defined since there is no other ( ) string.


Ok, fixed that too...

Thanks again! If this works as expected I should be able to get the 
postfixadmin guys to add this to the default vacation.pl, with a 
description of how to use it...

--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org


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

2013-02-16 Thread Joseph Brennan



--On Saturday, February 16, 2013 8:08 AM -0500 Tanstaafl 
 wrote:



On 2013-02-15 10:25 AM, Joseph Brennan  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); }




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)...


Not exactly. If you chain them with elsif then the conditions are tested
in order until one matches, and any after that are not tested. If one of
the earlier conditions matched then your rule would never match.

Remove the + mark (and learn what .* means) and you're probably done.

In the debug statement, $1 will be the string in ( ) that matched, but
$2 is not defined since there is no other ( ) string.


Joe Brennan

--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org


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

2013-02-16 Thread Stephen J. Turnbull
Tanstaafl writes:
 > On 2013-02-15 10:25 AM, Joseph Brennan  wrote:

 > > I am uncertain what /.*+/ would do. Remove either * or +.

As Joseph says, change the first part of your regexp from "^From:.*+"
to "^from:.*" or "^from:.+" (I would choose the former because it's
more inclusive, thus less backscatter to those addresses).

 > Like I said, I've got no experience with regex at all - guess its
 > time to learn eh? ;)

Yes.  I don't know specifically about Perl/Python, but there are
definitely tools out there which will help you build regexps from such
lists of strings.

--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] rmlist results

2013-02-16 Thread Mark Sapiro
Thufir wrote:

>Are the below errors simply because I wasn't 
>running rmlist as sudo?  It should be run as sudo?


Yes. All Mailman's command line scripts need to run as root or
(preferably) as a user in Mailman's group (usually group mailman).

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan

--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org


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

2013-02-16 Thread Tanstaafl

On 2013-02-15 10:25 AM, Joseph Brennan  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-anyth...@example.com
anyth...@bounce.example.com
anyth...@bounce-reply.example.com
faceb...@example.com
anything.faceb...@example.com
anything-faceb...@example.com
anyth...@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...
--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org