summaryrefslogtreecommitdiff
path: root/Mailman/Handlers/Approve.py
Commit message (Collapse)AuthorAgeFilesLines
* Convert the Approve.py handler to an approved.py rule. Update the doctest toBarry Warsaw2007-12-291-116/+0
| | | | | | | | | use the rule check instead of handler processing. Add a test for stripping the header from the text/html part to the doctest. Add Mailman.app.rules.find_rule() to return a named rule. Fix a few typos.
* Changes to support the Approved/Approve header with the new userBarry Warsaw2007-10-061-38/+26
| | | | | | | | | | model. Specifically, where a mailing list used to have both a password and a moderator password, both of which could be used in the Approved header, now a mailing list has only a shared moderator password. This moderator password's only purpose in life is to allow for Approved header posting. test_handlers.py is now completely ported to doctests, so it's removed.
* Improved processing of an Approve(d): body line by decoding the body payloadmsapiro2007-06-091-5/+21
| | | before looking for/deleting the Approve(d): line.
* Update copyright years.bwarsaw2007-01-191-1/+1
|
* Fix test_message.py by finishing the wind-through of the configuration objectbwarsaw2006-07-081-6/+6
| | | | | | | | | | | | | | | | 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
* Port cleaning changes forward from 2.1-maint branch.bwarsaw2005-12-301-17/+18
|
* Scan other text/* parts for Approve(d): <password> - bug 1181161.msapiro2005-12-211-1/+29
|
* Don't delete line following first body line Approve(d)msapiro2005-11-131-1/+1
|
* back porting from 2.1.6tkikuchi2005-08-281-6/+7
|
* FSF office has moved. chdcking in for MAIN branch.tkikuchi2005-08-271-1/+1
|
* process(): Initialize the line local variable to the empty string, inbwarsaw2002-10-141-0/+1
| | | | case the message has an empty body.
* process(): I really could have sworn this was already there, butbwarsaw2002-10-081-4/+30
| | | | | | | apparently not. If the first non-whitespace line of the first text/plain subpart has an Approved or Approve header, it's checked for the admin password, but /only/ if there's no real Approved or Approve header in the message (don't use both!).
* Bump copyright years.bwarsaw2002-03-151-1/+1
|
* process(): If the Approved: header has a password match, also add thebwarsaw2002-03-151-0/+2
| | | | | | `adminapproved' metadata key. This is the only unspoofable way for the list owners to get a message through while the emergency hold is on.
* process(): Pass a failobj of [] to the get_all() call so that even ifbwarsaw2001-10-091-1/+1
| | | | the field is missing, we get a valid list object.
* Convert from mimelib to email.bwarsaw2001-10-011-1/+1
|
* Update a comment.bwarsaw2001-05-311-1/+3
|
* process(): Use the new world order for doing authentication. Sincebwarsaw2001-05-311-4/+8
| | | | | | | | | | | | | this isn't a web auth, we just use Authenticate() and pass in the appropriate authcontext. In this case, we're allowing either the list moderator or the list owner to approve messages. We're specifically /not/ allowing the site administrator in order to reduce the urge to send the site password through email in the clear. Also, accept either "Approved: password" or "Approve: password" headers.
* Conversion to mimelib.bwarsaw2001-02-151-17/+10
| | | | | | | | | | De-string-module-ify Other Python 2.0 constructs used where appropriate. Get rid of HandlerAPI references -- this module is obsolete. LoopError is moved to the Errors module.
* process(): Get rid of the string module, in favor of string methods.bwarsaw2000-12-201-7/+2
| | | | | filterfunc(): Get rid of this too, since we can use a list comprehension instead (which I think is just as clear).
* Many changes to make message delivery more robust in the face ofbwarsaw2000-05-081-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | failures, bugs, and lock acquisition timeouts. Instead of storing information about the progress of the delivery on the Message object, we pass around a parallel data structure called `msgdata' (current just a dictionary). All calculated information is passed through this object, but this changes the API to handler modules. They now take three arguments: the mailing list, the message object, and the msgdata. WARNING: This may change before 2.0 final. Specific changes include: HandlerAPI DiscardMessage(), HandlerAPI.SomeRecipientsFailed(): New shared exceptions. pipeline_deliver(): removed LIST_PIPELINE: global containing the primary list delivery pipeline DelivertoList: Revamped main entry point into message delivery to list membership. Takes three arguments: the mailing list, the message object, and the msgdata dictionary. This digs the pipeline to use out of the msgdata (allowing resumption of prematurely interrupted pipeline deliveries). Then each module is called in turn, and the shared exceptions are caught. As each module is completed successfully, it is removed from the head of the pipeline. This function returns the number of pipeline modules remaining to be executed (i.e. a return of 0 means DeliverToList() is done with this message and it can be dequeued). A catch-all is included in case some unexpected exception occurs (say a bug or typo in one of the delivery modules). Such an error will queue the message, so at least it doesn't just get lost. We try to never just lose a message. RedeliverMessage(), DeliverToUser(): reimplemented in terms of DeliverToList(). Acknowledge, AfterDelivery, CalcRecips, Cleanse, CookHeaders, Decorate, Replybot, ToArchive, ToUsenet Fix the function signature to match the new API (three arguments), and changed the implementations to extract delivery information from msgdata instead of as attributes of the message object. Approved Same as above, but also removed NotApproved exception. LoopError is now multiply derived from HandlerAPI.DiscardMessage and Errors.MMLoopingPost. Hold Same as above, but also changed slightly the way an exception is raised when a message is held. hold_for_approval() now takes four arguments (the msgdata parameter has been added), and the exc object can be a class or instance. If it's a class, it is simply zero-arg'd instantiated. We also use the str() of the exception to get us the reason for the hold. This allows us to override HandlerAPI.MessageHeld.__str__() for MessageToBig so that we can include the size of the message being held. SMTPDirect Same as above, but instead of explicitly enqueuing the messages when some or all of the recipient deliveries failed, just raise a HandlerAPI.SomeRecipientsFailed exception and let DeliverToList() manage the enqueuing. Thus queue_message() is removed. Sendmail Same as above, but if any chunks fail delivery, those recipients are queued by raising SomeRecipientsFailed. SpamDetect Same as above, except that if a regexp matches, a SpamDetect exception is raised directly. The DeliverToList() framework discards these spam messages instead of holding them for approval. ToDigest Same as above, except that if a digest is prepared for delivery, it is not sent directly via mlist.Post(). Instead, the message is queued for delivery, thereby relinquishing the lock soon. This means that digests will only be sent the next time qrunner runs.
* Update the copyright lines to include the years 1999 & 2000.bwarsaw2000-03-211-1/+1
|
* filterfunc(): Uh, fixed this because the old way never actually caughtbwarsaw1999-11-241-1/+1
| | | | | x-beenthere's. I'm hoping this was a transcription error on my part, otherwise this never worked, and we've been lucky!
* process(): Only test for `approved' attribute. All others are testedbwarsaw1999-11-111-3/+1
| | | | elsewhere.
* New pipeline delivery modulebwarsaw1999-11-101-0/+66
"""Determine whether the message is approved for delivery. This module only tests for definitive approvals. IOW, this module only determines whether the message is definitively approved or definitively denied. Situations that could hold a message for approval or confirmation are not tested by this module. """