HighDots Forums  

Re: regexp help

Python Python programming language mailing list


Discuss Re: regexp help in the Python forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mark Sapiro
 
Posts: n/a

Default Re: regexp help - 10-21-2009 , 11:19 PM






Savoy, Jim wrote:
Quote:
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\.person\.name@gmail\.com(\s|>|$ )

and the action Accept.
-------

and that is exactly what I want to do - bypass the header_filter_rules.

No, that is not what you want to do. What you want to do is bypass
other non-header_filter_rules holds (i.e. post from non-member) with a
header_filter_rule. You can't do that.

You can do it with accept_these_nonmembers, but not in your case,
because accept_these_nonmembers only works on the From: (or other
'sender' header, not on the To:.


Quote:
But I am
afraid I don't quite understand this advice, Mark. How can I make this
spam rule
supercede other rules (like the one that says the list is moderated).

You can't.


Quote:
There
is no "add new item" button when you haven't got any spam rules. That
only
comes up when after I create me first rule, which is not superceding the
moderation
rule.

I should probably not say anything else until Mark logs in. He's
probably looking at
this huge chain and wanting to crack our skulls together like Moe.

It's not your thread - it's the two week backlog of just approved
posts.

What you need is a custom handler. See the FAQ at
<http://wiki.list.org/x/l4A9> for how to install one. 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):
if mlist.internal_name <> 'abc-l':
return
if cre.search(msg.get('to', '')):
msgdata['approved'] = 1
# Used by the Emergency module
msgdata['adminapproved'] = 1


Of course, you adjust the regexp 'unique\.name' and the list name
'abc-l' to suit. The handler needs to be in the pipeline before
Moderate.

If you make a list specific pipeline for just this list, you can leave
out the

if mlist.internal_name <> 'abc-l':
return

What this does is nothing if the list isn't abc-l. If it is abc-l and
if the contents of the To: header of the message matches the regexp in
re.compile() case insensitively, then the approved and adminapproved
flags will be set in the message metadata and the message won't be
subject to any holds.

--
Mark Sapiro <mark (AT) msapiro (DOT) net> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan

------------------------------------------------------
Mailman-Users mailing list Mailman-Users (AT) python (DOT) 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/python%40highdots.com

Reply With Quote
  #2  
Old   
liste yoneticisi
 
Posts: n/a

Default Couldn't change newlist.txt for tr version - 11-02-2009 , 08:04 AM






Hi;

I tried to make a global change for newlist welcome message.

For English version, I changed the file;
/cwis/htdocs/mailman/templates/en/newlist.txt

and it worked. ie the changes effected in the newlist information file.

But the similar changes didn't affected for
/cwis/htdocs/mailman/templates/tr/newlist.txt
file,

ie for Turkish new lists, list owner receives older version of
newlist.txt, the file that doesn't exist anywhere.

Can you please tell me what is wrong about it?

Mailman Version is 2.1.19
------------------------------------------------------
Mailman-Users mailing list Mailman-Users (AT) python (DOT) 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/python%40highdots.com

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.