|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 | Next > |
|
|
regexp helpHi 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.name@...) and set up the mailing list (we'll call it abc-l@...). The only way I can think of getting the mailing list to accept the forwarded mail is to use the spam filters under [Privacy Options]. I create a new Spam Filter Rule like so: /^.*unique.name.*$/ (I will make this more specific later) But that doesn't seem to work. Mail sent to unique.name@... returns the error message "you are not allowed to post to this mailing list" to the original sender. I assumed that unique.name would be somewhere in the email headers, which is what the Spam rules are filtering on, right? Any ideas what I am doing wrong? Thanks. - jim - - ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@... 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/lists%40nabble.com |
|
|
Re: regexp helpWhy don't you just add the email account to the list, set it for no mail,
and set it so it's unmoderated? > -----Original Message----- > From: mailman-users-bounces+g.booth=usm.edu@... > [mailto:mailman-users-bounces+g.booth=usm.edu@...] On > Behalf Of Savoy, Jim > Sent: Wednesday, October 21, 2009 11:24 AM > To: mailman-users@... > 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 (moderated to everyone accept the > mail from > this particular email > > account). So I created the account (we'll call it > unique.name@...) and set up the mailing > > list (we'll call it abc-l@...). > > > > The only way I can think of getting the mailing list to accept the > forwarded mail is to use the spam > > filters under [Privacy Options]. I create a new Spam Filter Rule like > so: > > > > /^.*unique.name.*$/ > > > > (I will make this more specific later) > > > > But that doesn't seem to work. Mail sent to unique.name@... > returns the error message > > "you are not allowed to post to this mailing list" to the original > sender. I assumed that unique.name > > would be somewhere in the email headers, which is what the Spam rules > are filtering on, right? > > > > Any ideas what I am doing wrong? > > > > Thanks. > > > > - jim - > > - > > > > ------------------------------------------------------ > Mailman-Users mailing list Mailman-Users@... > 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/g.booth%4 > 0usm.edu ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@... 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/lists%40nabble.com |
|
|
Re: regexp helpGeorge 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 is not technically coming from that account. It's coming from whoever originally sent it (the unique.name account just forwards). That is why I thought I could try to circumvent it by using the spam filter to just search all of the headers for an occurance of "unique.name". - jim - ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@... 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/lists%40nabble.com |
|
|
Re: regexp helpI 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" <unique.name@...> Since there is a dot in the username, I thought maybe that was fouling up the regular expression, so I tried all of these: \nto: .*unique\.name to: .*unique\.name to: .*unique to no avail... - jim - ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@... 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/lists%40nabble.com |
|
|
|
|
|
|
|
|
Re: regexp helpOn 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 account (an inquiries-type of > account). Ok, maybe I'm missing the point here. couldn't you just allow all non-member postings and manually approve subscriptions? Define the address as an alternate name for the list if you really don't want to give out the list address. On one site I administer, we've converted our simple Email forwarder public Email address to a mailing list, with the project managers as the ownly subscribers. Apart from the odd bit of fun we have with Reply-to, it works pretty well. It helps to fascilitate discussion between the managers and encourages managers to copy everyone else on messages sent back to people outside the project. Geoff. ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@... 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/lists%40nabble.com |
|
|
Re: regexp helpSavoy, 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\.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:. >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. >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@...> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@... 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/lists%40nabble.com |
|
|
Couldn't change newlist.txt for tr versionHi;
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@... 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/lists%40nabble.com |
|
|
Re: Couldn't change newlist.txt for tr versionliste yoneticisi wrote:
> >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? In some cases you have to restart Mailman after making template changes because templates are cached in a qrunner, but this normally affects only templates related to archives and shouldn't be required here, so I don't know what could be wrong. However, assuming /cwis/htdocs/mailman/ is the Mailman installation $prefix directory, you should not edit the files you edited, because if you ever upgrade, your changes will be overwritten. To create sitewide edited templates, you should create the directories /cwis/htdocs/mailman/templates/site/tr/ and /cwis/htdocs/mailman/templates/site/en/ and put your edited templates there. That way, they will not be overwritten in an upgrade. See the FAQ at <http://wiki.list.org/x/jYA9>. -- Mark Sapiro <mark@...> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@... 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/lists%40nabble.com |
|
|
Re: regexp help>Mark Sapiro wrote:
>What you need is a custom handler. See the FAQ at <http://wiki.list.org/x/l4A9> 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): > 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. OK - I made a file called Foo.py and put it in /Mailman/Handlers. I then inserted this module right before 'Moderate' in the pipeline (I editted Defaults.py for this - just as a temporary measure to see if it would work). I will remove this and add a line to mm_cfg.py later. I then stopped/started the Mailman processes (not sure if that's necessary, but I did it anyway). Now the test email I sent is stuck in the shunt queue and this is in the errors log: File "/Mailman/Handlers/Foo.py", line 2 cre = re.compile('unique\.name', re.IGNORECASE) def process(mlist, msg, msgdata): ^ SyntaxError: invalid syntax It didn't line up well in this email message, but the carat (^) is positioned under the 'f' in the "def". I know diddly about Python (and not that much more about Mailman, really) so I'm not sure how to fix the problem. Any ideas? Thanks! - jim - ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@... 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/lists%40nabble.com |
|
|
Re: regexp helpI 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 messing with, but I guess if there is a syntax error in it, it breaks the entire pipeline (maybe). ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@... 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/lists%40nabble.com |
|
|
Re: regexp helpI 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). ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@... 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/lists%40nabble.com |
|
|
Re: regexp helpOn 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 Mailman/Python). No. The code is automatically compiled if there is no pyc file or the py file is different. Presumably there's no pyc file because of your syntax error. At a guess, I'd say that the def statement should be on a new line, but I'm not a Python expert. Geoff. ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@... 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/lists%40nabble.com |
|
|
Re: regexp helpSavoy, Jim wrote:
>>Mark Sapiro wrote: > >>What you need is a custom handler. See the FAQ at ><http://wiki.list.org/x/l4A9> 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): >> 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. > >OK - I made a file called Foo.py and put it in /Mailman/Handlers. >I then inserted this module right before 'Moderate' in the pipeline (I >editted >Defaults.py for this - just as a temporary measure to see if it would >work). >I will remove this and add a line to mm_cfg.py later. > >I then stopped/started the Mailman processes (not sure if that's >necessary, but >I did it anyway). Now the test email I sent is stuck in the shunt queue >and this >is in the errors log: > >File "/Mailman/Handlers/Foo.py", line 2 > cre = re.compile('unique\.name', re.IGNORECASE) def process(mlist, >msg, msgdata): > ^ > SyntaxError: invalid syntax 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. -- Mark Sapiro <mark@...> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@... 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/lists%40nabble.com |
|
|
Re: regexp helpSavoy, 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 affect the one list I am >messing >with, but I guess if there is a syntax error in it, it breaks the entire >pipeline (maybe). Because your handler is in the GLOBAL_PIPELINE and it has a syntax error, every message encounters the SyntaxError exception and the message is shunted. -- Mark Sapiro <mark@...> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@... 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/lists%40nabble.com |
|
|
Re: regexp helpMark 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. These words you are saying are all true. I just "cut" your code in Outlook and "pasted" it in vi. I will try it again with the indenting you suggested (reminds me of Fortran!). Thanks. - jim - ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@... 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/lists%40nabble.com |
|
|
Re: regexp helpSavoy, 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 spaces. > >These words you are saying are all true. I just "cut" your code in >Outlook and "pasted" it in vi. I will try it again with the indenting >you suggested (reminds me of Fortran!). Thanks. Depending on the options set in vi, it can do horrible things to indentation when you paste things in :( Python is not at all like Fortran, In Fortran (at least through Fortran IV - I never did much with Fortran 77 and nothing beyond that) white space except for line endings is totally insignificant. True, you have some formatting restrictions like positions 1 - 5 for statement numbers, 6 for continuation and 7 - 72 for statements (although some compilers relaxed these), but consider that the compiler's parser/tokenizer doesn't know whether do 5 i = 1, 10 is a do loop or an assignment to a variable named do5i until it gets to the comma. In Python, whitespace is of utmost significance. You either love it or hate it, but block structure is based entirely on indentation. -- Mark Sapiro <mark@...> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@... 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/lists%40nabble.com |
|
|
Re: regexp help>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 viewing it with other mail clients, just for kicks. But now that I know that whitespace is critical in Python, I will be more careful. >Python is not at all like Fortran, In Fortran (at least through Fortran IV - I never did much with Fortran 77 and nothing beyond that) white space except for line endings is totally insignificant. True, you have some formatting restrictions like positions 1 - 5 for statement numbers, 6 for continuation and 7 - 72 for statements (although some compilers relaxed these), but consider that the compiler's parser/tokenizer doesn't know whether I was loosely referring to Fortran reserving certain columns for certain things. I barely remember it at all (that was back in my pre-Commodore64 (PEEKin' and POKEin' anyone?), punched-hole card days). - jim - ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@... 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/lists%40nabble.com |
|
|
Re: regexp help>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 and column 9 is indented 8 spaces from column 1 which is what I meant. And line 3 should not be indented, but also not be joined to the end of line 2 which is apparently the only real problem with your file. Look at my original in the archive at <http://mail.python.org/pipermail/mailman-users/2009-October/067496.html> or even as quoted in your reply at <http://mail.python.org/pipermail/mailman-users/2009-November/067555.html>. Both of those show proper formatting. I guess that's just one more thing we can't trust Outlook to do. BTW, indentation in steps of 4 is only a convention, it isn't mandatory. The indentation could be 1 space and 2 spaces or 1 tab and 2 tabs or even 4 spaces and 1 tab, although mixing spaces and tabs is dangerous and highly frowned upon. However, in any case, the highest level (the first 3 lines in the example) must not be indented at all. -- Mark Sapiro <mark@...> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@... 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/lists%40nabble.com |
| < Prev | 1 - 2 | Next > |
| Free embeddable forum powered by Nabble | Forum Help |