summaryrefslogtreecommitdiff
path: root/Mailman/Handlers/Moderate.py
Commit message (Collapse)AuthorAgeFilesLines
* Reorganize doctests, moving handler documentation into Mailman/handlers/docs.Barry Warsaw2008-01-241-168/+0
| | | | Rename all handlers to be more PEP 8 friendly, i.e. lowercased.
* Update copyright years.bwarsaw2007-01-191-1/+1
|
* Fix test_message.py by finishing the wind-through of the configuration objectbwarsaw2006-07-081-3/+3
| | | | | | | | | | | | | | | | and fixing the invocation and shutdown of mailmanctl. While the tests in this module work individually, they do not yet work as a group. -C added to testall.py, and mailmanctl now passes that flag on to qrunner. UserNotification sets reduced_list_header in the msgdata, but the behavior of this flag has changed. It used to suppress List-Help, List-Subscribe, and List-Unsubscribe as well as List-Post and List-Archive. However, List-Help, List-Subscribe and List-Unsubscribe should definitely be included in UserNotifications, and List-Post has a different variable controlling it now. Therefore, always add List-Help, List-Subscribe, and List-Unsubscribe. Some style updates to Message.py
* - Convert all logging to Python's standard logging module. Get rid of allbwarsaw2006-04-171-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | traces of our crufty old Syslog. Most of this work was purely mechanical, except for: 1) Initializing the loggers. For this, there's a new module Mailman/loginit.py (yes all modules from now on will use PEP 8 names). We can't call this 'logging.py' because that will interfere with importing the stdlib module of the same name (can you say Python 2.5 and absolute imports?). If you want to write log messages both to the log file and to stderr, pass True to loginit.initialize(). This will turn on propagation of log messages to the parent 'mailman' logger, which is set up to print to stderr. This is how bin/qrunner works when not running as a subprocess of mailmanctl. 2) The driver script. I had to untwist the StampedLogger stuff and implement differently printing exceptions and such to log/error because standard logging objects don't have a write() method. So we write to a cStringIO and then pass that to the logger. 3) SMTPDirect.py because of the configurability of the log messages. This required changing SafeDict into a dict subclass (which is better than using UserDicts anyway -- yay Python 2.3!). It's probably still possible to flummox things up if you change the name of the loggers in the SMTP_LOG_* variables in mm_cfg.py. However, the worst you can do is cause output to go to stderr and not go to a log file. Note too that all entry points into the Mailman system must call Mailman.loginit.initialize() or the log output will go to stderr (which may occasionally be what you want). Currently all CGIs and qrunners should be working properly. I wish I could have tested all code paths that touch the logger, but that's infeasible. I have tested this, but it's possible that there were some mistakes in the translation. - Mailman.Bouncers.BounceAPI.Stop is a singleton, but not a class instance any more. - True/False code cleanup, PEP 8 import restructuring, whitespace normalization, and copyright year updates, as appropriate.
* back porting from 2.1.6tkikuchi2005-08-281-1/+5
|
* FSF office has moved. chdcking in for MAIN branch.tkikuchi2005-08-271-1/+1
|
* update copyright yearsbwarsaw2003-05-231-1/+1
|
* process(): Add a short-circuit on the member moderation checks whenbwarsaw2003-05-231-1/+1
| | | | | | | | | the message was pulled from nntp. I'm not 100% sure this is the right solution (e.g. should this be a list config option?) but it fixes the problem that Mike Avery was having, and that we'll soon have when we move python-list! Backport candidate.
* do_discard(): Make sure the internal text/plain message has thebwarsaw2002-12-311-2/+4
| | | | | correct character set for the matching language. Closes SF bug #659157.
* ModeratedMemberPost.reason: Some people took offense at this message.bwarsaw2002-12-091-1/+9
| | | | | | See the comment, and this archived message. http://mail.python.org/pipermail/mailman-developers/2002-November/014034.html
* process(): When holding non-member postings, either because they're onbwarsaw2002-10-221-6/+6
| | | | | | | hold_these_nonmembers or because the generic_nonmember_action is 1 (hold), hold them with NonMemberPost instead of ModeratedPost. Fixes SF #609692, as suggested by Les Niles and Tokio Kikuchi.
* ModeratedMemberPost: Reword the reason for doing this hold.bwarsaw2002-07-091-1/+1
|
* hold_for_approval(): Get the sender address from the msgdatabwarsaw2002-05-071-0/+1
| | | | | | | | | | | dictionary's `sender' key, or the msg.get_sender() if not available. This lets exceptions pass the sender through the metadata dictionary. Used by Moderate.py to specify the failing address as retrieved from get_senders() -- note the plural -- which has a different lookup scheme than get_sender(). Moderate.process(): Set the tested sender address in the msgdata's dictionary.
* GetAdminEmail() eradication campaign.bwarsaw2002-03-261-1/+1
| | | | | | | process(), hold_for_approval(), do_discard(): Make the notification email appear to come from the -bounces address. When the sender is for human consumption, make it the -owner address (or in the case of Cleanse.py for anonymous lists, the list posting address).
* process(): Application of Jason Mastaler's patch #509386 which loosensbwarsaw2002-03-071-9/+10
| | | | | | | | | | | | | | | | | | | the membership test to check additional headers. I've modified Jason's patch in the following ways: - get_author() -> get_senders() even though I suggested the former. ;) I'd like to eventually deprecate get_sender() so this will be its eventual replacement. - Some implementation details. do_discard(): Changed the message that gets sent with auto-discarded messages. It might have been discarded because of the default non-member action, in which case the old message wasn't really accurate. I don't think the reason for discarding is all that important right now. Translators: beware!
* do_discard(): Set up the outer bounce message the same way we set upbwarsaw2002-03-011-5/+4
| | | | | the admin message in other checkins; specifically, we use set_type() to set the Content-Type:
* do_reject(): Better grammar for the reject message.bwarsaw2002-03-011-3/+3
|
* process(), hold_for_approval(), do_discard(): When creating thebwarsaw2002-02-111-1/+2
| | | | | | | | UserNotification message object, pass in the language that the message should be in. This allows us to get the character set and header encodings right. Patch by Ben Gertzfield.
* Some elaboration of the member moderation flag semantics. Now it'sbwarsaw2002-01-211-2/+25
| | | | | | | | | | | | | | | possible to assign an action to the flag, which ought to work better for e.g. announce-only lists. Specifically, process(): If we're looking at a member and that member has their moderation flag turned on, then we look at mlist.member_moderation_action. This is a 3-way selector specifying whether the message should be held for approval, rejected (bounced), or discarded. There's also a member_moderation_notice attribute which includes text to send back to the member when their posting is automatically rejected (WIBNI we could include that text in any held or discard notification? Too much code disruption to do that right now).
* do_discard(): Fix the calculation of the VARHELP url for thebwarsaw2002-01-081-2/+2
| | | | discard_these_nonmembers variable.
* process(): Simplify by calling out to matches_p() to do the actualbwarsaw2001-11-211-9/+28
| | | | | | | | | match of the sender against the nonmember addresses. matches_p(): Implements the matching rules: - match literal addresses first - match re's next (they must start with a ^ which stays as part of the regular expression)
* intermediatebwarsaw2001-10-151-0/+110