summaryrefslogtreecommitdiff
path: root/Mailman/Handlers/ToArchive.py
Commit message (Collapse)AuthorAgeFilesLines
* Reorganize doctests, moving handler documentation into Mailman/handlers/docs.Barry Warsaw2008-01-241-37/+0
| | | | Rename all handlers to be more PEP 8 friendly, i.e. lowercased.
* Reorganize the qrunner infrastructure. First, the package has been renamedBarry Warsaw2007-09-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | from Mailman.Queue to Mailman.queue (note the case change to be more PEP 8 compliant). The Switchboard and Runner classes have been moved into the package __init__.py and the previous class modules have been removed. The switchboard cache is removed; I don't think it was ultimately buying us much. Now, just import the Switchboard class and instantiate it directly. Added an IRunner interface. Renamed the ArchRunner to ArchiveRunner. bin/qrunner and bin/mailmanctl are updated accordingly. For the former, it no long accepts -r=All to run all qrunners. You can still use the short name (e.g. --runner=incoming) to run the built-in queue runners, but this design will eventually allow for plugin qrunners by allowing them to be run specifying the full package path to the class. It also now accepts a leading dot to indicate a qrunner class relative to the Mailman.queue package.
* Convert ToArchive tests to doctests and do a minimal amount of handler moduleBarry Warsaw2007-07-111-4/+1
| | | | cleanup (really, not much was necessary).
* Update copyright years.bwarsaw2007-01-191-1/+1
|
* Fix test_message.py by finishing the wind-through of the configuration objectbwarsaw2006-07-081-2/+2
| | | | | | | | | | | | | | | | 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
* Back out Revision 2.30 patch for email.Message.set_payload() bugtkikuchi2006-01-291-11/+2
| | | | because it is overwrapped in Mailman.Message.
* Port cleaning changes forward from 2.1-maint branch.bwarsaw2005-12-301-5/+6
|
* Fixes for email.set_payload() not distinguish parsed or virgin payload.tkikuchi2005-12-241-1/+10
|
* FSF office has moved. chdcking in for MAIN branch.tkikuchi2005-08-271-1/+1
|
* process(): Ignore all values of X-No-Archive: header; it's merebwarsaw2002-02-261-5/+5
| | | | presence is enough to avoid archiving the message.
* Use cStringIO directly instead of our own hack-around StringIObwarsaw2001-10-011-1/+1
| | | | module.
* process(): We don't need to set the `received_time' metadata item,bwarsaw2001-05-141-1/+0
| | | | since this is guaranteed to be filled in by the runner.
* process(): `received_time' should only be added to the message'sbwarsaw2001-05-011-2/+2
| | | | | | metadata if it's not already there. Usually it will be since scripts/post and scripts/auto add it. Python 2.x's {}.setdefault() does this nicely.
* Conversion to mimelib.bwarsaw2001-02-151-24/+12
| | | | | | | | | De-string-module-ify Other Python 2.0 constructs used where appropriate. Delete the Date: field kludge for mlist.clobber_date. This is now handled in the ArchRunner.
* process(): Get rid of the string module in favor of string methods.bwarsaw2000-12-201-3/+2
|
* process(): Don't try to restore the date if it is None, otherwise webwarsaw2000-10-061-1/+2
| | | | get an annoying exception.
* process(): Honor "X-No-Archive: yes", which means don't add thebwarsaw2000-10-051-2/+4
| | | | | | message to the archive. Retain "X-Archive: no" for backwards compatibility with my own hallucinations :). Resolves SF bug #115644.
* process(): Do the clobber_date logic here instead of inbwarsaw2000-09-141-2/+21
| | | | | | | | Archiver/Archiver.py, because We want clobber_date to affect what goes in Pipermail or the external archiver. Be sure to restore the original date after the archiver gets its hands on the message. If clobber_date is turned on, set the X-Original-Date: header to the original Date: field value.
* process(): ArchiveMail() now takes a second argument, msgdata, whichbwarsaw2000-06-231-1/+1
| | | | will get filled with the pids of any children that get forked.
* Many changes to make message delivery more robust in the face ofbwarsaw2000-05-081-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
|
* process(): Short-circuit return for when the list object attributebwarsaw2000-02-081-1/+1
| | | | `archive' is false (i.e. archiving was disabled by the list admin).
* process(): If the message has a header like "X-Archive: No" (casebwarsaw2000-02-031-0/+4
| | | | | insensitive of course), then mlist.ArchiveMail() is not called, and the message doesn't go to the archive.
* New pipeline delivery modulebwarsaw1999-11-101-0/+28
"""Add the message to the archives."""