Re: [Mailman-Users] regexp help

2009-11-04 Thread Savoy, Jim
>Mark Sapiro wrote: >That would be the To: header of the reject notice. Yes. That is the message I am analyzing. >Mailman sends a multipart/mixed message with two parts - a text/plain >part containing the reject reason and a message/rfc822 part containing >the post as received by Mailman. It is

Re: [Mailman-Users] regexp help

2009-11-03 Thread Savoy, Jim
Mark Sapiro wrote: >Did you put 'Foo' back in the GLOBAL_PIPELINE prior to 'Moderate' and restart Mailman? I did. >What happens when you mail to test.account? Is the mail rejected by Mailman? Does the To: header in the mail in the reject notice contain 'test.account'? Yes, it is rejected. And

Re: [Mailman-Users] regexp help

2009-11-03 Thread Mark Sapiro
Savoy, Jim wrote: > >Mark Sapiro wrote: > >>Did you put 'Foo' back in the GLOBAL_PIPELINE prior to 'Moderate' and >restart Mailman? > >I did. > >>What happens when you mail to test.account? Is the mail rejected by >Mailman? Does the To: header in the mail in the reject notice contain >'test.account

Re: [Mailman-Users] regexp help

2009-11-03 Thread Mark Sapiro
Savoy, Jim wrote: >Hi Mark, > > I got it to compile properly, but it is still not working. >I made the following changes in Foo.py: > >import re >cre = re.compile('test.account', re.IGNORECASE) >def process(mlist, msg, msgdata): >if mlist.internal_name <> 'abc-l': >return >if cre

Re: [Mailman-Users] regexp help

2009-11-03 Thread Savoy, Jim
Hi Mark, I got it to compile properly, but it is still not working. I made the following changes in Foo.py: import re cre = re.compile('test.account', re.IGNORECASE) def process(mlist, msg, msgdata): if mlist.internal_name <> 'abc-l': return if cre.search(msg.get('to', '')):

Re: [Mailman-Users] regexp help (OT: Edit and Mail)

2009-11-03 Thread Chr. von Stuckrad
On Mon, 02 Nov 2009, Savoy, Jim wrote: > >Depending on the options set in vi, it can do horrible things to > indentation when you paste things in :( :-) seen that! Therefore modern vims have :set paste and as long as you not 'set nopaste' *no* munging of pastes will be done! I'm needing/using th

Re: [Mailman-Users] regexp help

2009-11-02 Thread Mark Sapiro
>I just looked at your original posting (using Outlook) and line 3 is >not indented, but rather continuous from line 2, and the other indents >are in columns 5 and 9 (not 4 and 8). I shall try viewing it with other >mail clients, just for kicks. Right - column 5 IS indented 4 spaces from >column 1

Re: [Mailman-Users] regexp help

2009-11-02 Thread Savoy, Jim
>Depending on the options set in vi, it can do horrible things to indentation when you paste things in :( I just looked at your original posting (using Outlook) and line 3 is not indented, but rather continuous from line 2, and the other indents are in columns 5 and 9 (not 4 and 8). I shall try vi

Re: [Mailman-Users] regexp help

2009-11-02 Thread Mark Sapiro
Savoy, Jim wrote: > >>You used some kind of word processor to create foo.py that concatenated >lines 2 and 3 into a single line. Your Foo.py file must be just like >my original example with lines 1, 2 and 3 at the left margin, lines 4 >and 6 indented 4 spaces and lines 5, 7, 8 and 9 indented 8 spac

Re: [Mailman-Users] regexp help

2009-11-02 Thread Savoy, Jim
Mark Sapiro wrote: >You used some kind of word processor to create foo.py that concatenated lines 2 and 3 into a single line. Your Foo.py file must be just like my original example with lines 1, 2 and 3 at the left margin, lines 4 and 6 indented 4 spaces and lines 5, 7, 8 and 9 indented 8 spaces.

Re: [Mailman-Users] regexp help

2009-11-02 Thread Mark Sapiro
Savoy, Jim wrote: >I also just noticed that the shunt queue started to fill up with >messages >for other lists as well, so I quickly removed the line I had inserted >into >Defaults.py, stopped/started the Mailman processes, and successfully >unshunted >everything. I was hoping the code would only

Re: [Mailman-Users] regexp help

2009-11-02 Thread Mark Sapiro
Savoy, Jim wrote: >>Mark Sapiro wrote: > >>What you need is a custom handler. See the FAQ at > for how to install one. > >Thank you. Done. > >>In your case, the handler is very simple - just 9 lines. > >>import re >>cre = re.compile('unique\.name', re.IGNORECASE) >>def

Re: [Mailman-Users] regexp help

2009-11-02 Thread Geoff Shang
On Mon, 2 Nov 2009, Savoy, Jim wrote: I also just noticed that all of the other handlers have an accompanying .pyc file, but my Foo.py does not. Perhaps that 'c' stands for "compiled" It does. and I was supposed to compile the code first? (probably seems obvious to someone familiar with Mail

Re: [Mailman-Users] regexp help

2009-11-02 Thread Savoy, Jim
I also just noticed that all of the other handlers have an accompanying .pyc file, but my Foo.py does not. Perhaps that 'c' stands for "compiled" and I was supposed to compile the code first? (probably seems obvious to someone familiar with Mailman/Python). -

Re: [Mailman-Users] regexp help

2009-11-02 Thread Savoy, Jim
I also just noticed that the shunt queue started to fill up with messages for other lists as well, so I quickly removed the line I had inserted into Defaults.py, stopped/started the Mailman processes, and successfully unshunted everything. I was hoping the code would only affect the one list I am m

Re: [Mailman-Users] regexp help

2009-11-02 Thread Savoy, Jim
>Mark Sapiro wrote: >What you need is a custom handler. See the FAQ at for how to install one. Thank you. Done. >In your case, the handler is very simple - just 9 lines. >import re >cre = re.compile('unique\.name', re.IGNORECASE) >def process(mlist, msg, msgdata):

Re: [Mailman-Users] regexp help

2009-10-21 Thread Mark Sapiro
Savoy, Jim wrote: > >I just re-read Mark's comments, and he says: > >--- >So assuming that what you want is to bypass the other >header_filter_rules, you need to "add new item" before the current rule >1 so the new rule becomes #1. Then the new rule 1 regexp should be > > ^from:.*(\s|<)some\.p

Re: [Mailman-Users] regexp help

2009-10-21 Thread Geoff Shang
On Wed, 21 Oct 2009, Savoy, Jim wrote: Yep - I could do that. Have exim rewrite the headers before it sends out the message, but the people on the mailing list do want to know who the email originally came from. They just don't want everyone to have access to their mailing list, just this one ac

Re: [Mailman-Users] regexp help

2009-10-21 Thread Savoy, Jim
>CNulk writes: >Hi Jim, >I may be completely wrong (heck, wouldn't be the first time), but why >not have your "unique.name" address be an alias to a simple >bash/perl/etc. script which simply accepts the email message, rewrites >the message to be from the unique.name address, and sends it on to t

Re: [Mailman-Users] regexp help

2009-10-21 Thread Savoy, Jim
>> To: "Name, Unique" >George Booth wrote: >Jim, I don't know if this will help, but this is what I use for our lists' >spam filters to accept from our domain: >^...@]+@(.+\.|)unique\.name$ >Worth a shot? OK, but the domain isn't "unique.name" - that is the username. The domain is uleth.ca.

Re: [Mailman-Users] regexp help

2009-10-21 Thread Savoy, Jim
I looked at one of the actual headers (I am not posting the actual name I am using as we don't want anyone to mail to it just yet!) but it looked like this: To: "Name, Unique" Since there is a dot in the username, I thought maybe that was fouling up the regular expression, so I tried all of thes

Re: [Mailman-Users] regexp help

2009-10-21 Thread Savoy, Jim
George Booth wrote: >Why don't you just add the email account to the list, set it for no mail, and set it so it's unmoderated? Well that was the first thing I did, but that didn't work because the mail is not technically coming from that account. It's coming from whoever originally sent it (the

Re: [Mailman-Users] regexp help

2009-10-21 Thread George Booth
f Of Savoy, Jim > Sent: Wednesday, October 21, 2009 11:24 AM > To: mailman-users@python.org > Subject: [Mailman-Users] regexp help > > Hi all - I am trying to have all of the mail sent to a certain email > account automatically forwarded > > to a moderated mailing list (modera

Re: [Mailman-Users] regexp help

2009-10-21 Thread Savoy, Jim
>Jim, try from: .*@(?!.*uleth.ca) The 'anything before the @ sign' is obvious, but the '?!.*' is to test for possible machine names, in case they're there. Nope. That failed. I added a "\n" to the front of this and that failed as well. I didn't think I would have to make any accommodations for t

Re: [Mailman-Users] regexp help

2009-10-21 Thread Savoy, Jim
>I wrote: >Anyway, just wanted to say that I fixed my regexp problem. I am running >an older version of Mailman, so tried this instead: > \nfrom:.*unique.name >and it worked! Looks like I spoke to soon. It actually did not work. I have also tried \n.*unique.name and that failed as well (I ass

[Mailman-Users] regexp help

2009-10-21 Thread Savoy, Jim
Hi all - I am trying to have all of the mail sent to a certain email account automatically forwarded to a moderated mailing list (moderated to everyone accept the mail from this particular email account). So I created the account (we'll call it unique.n...@some.domain) and set up the mailing lis

[Mailman-Users] regexp help

2009-10-21 Thread Savoy, Jim
Sorry to break the thread on this (my previous message didn't go through, so I guess this list is being moderated now). Anyway, just wanted to say that I fixed my regexp problem. I am running an older version of Mailman, so tried this instead: \nfrom:.*unique.name and it worked!

Re: [Mailman-Users] Regexp help - Matching Subjects to Hold Posts in Mailman 2.0.11

2005-05-30 Thread Jim Tittsler
On May 31, 2005, at 14:44, David Powell wrote: > One line has a tab b/w ":" and "[SPAM", another a space and the third > nothing. The other thing I wasn't sure about was if the first > letter of > subject is uppper case or not. If you are putting these in 2.0.x's bounce_matching_headers list

Re: [Mailman-Users] Regexp help - Matching Subjects to Hold Posts in Mailman 2.0.11

2005-05-30 Thread David Powell
Thanks for the help, to respond... > Life will be much easier for this kind of task if you upgrade to > Mailman 2.1.x; 2.1.6 is current. Agreed - I don't administer the server, but understand we're waiting for the new stable release of Debian (any day now). > Really, you should invest in Jeffre

Re: [Mailman-Users] Regexp help - Matching Subjects to Hold Posts in Mailman 2.0.11

2005-05-30 Thread Stephen J. Turnbull
> "David" == David Powell <(YANQ)" <[EMAIL PROTECTED]>> writes: Life will be much easier for this kind of task if you upgrade to Mailman 2.1.x; 2.1.6 is current. David> Here are the different regexp's that I've tried, none seem David> to work. Really, you should invest in Jeffrey Fri

[Mailman-Users] Regexp help - Matching Subjects to Hold Posts in Mailman 2.0.11

2005-05-30 Thread David Powell (YANQ)
Hi All, I've only recently discovered the world of regexps, so please bare with me. What I want to do is block messages whose subject starts with "[SPAM". Mail to my server goes through spamassassin first - it alters mail that it thinks is spam by adding [SPAM xx.xx] to the start of the subject.