summaryrefslogtreecommitdiff
path: root/Mailman/Handlers/HandlerAPI.py
Commit message (Collapse)AuthorAgeFilesLines
* Removed as obsolete. HandlerAPI is now subsumed by the IncomingRunnerbwarsaw2001-02-151-175/+0
| | | | and NNTPDirect is subsumed by the NewsRunner.
* RedeliverMessage(): Removed.bwarsaw2000-12-201-11/+3
| | | | | | | | DeliverToUser(): Don't put DELIVERY_MODULE in the pipeline; that's now handled by the OutgoingRunner. LIST_PIPELINE: Put ToUsenet at the end of the pipeline, and add ToOutgoing to make sure the message gets put in qfiles/out.
* First round integration of Juan Carlos's translatable string markings.bwarsaw2000-12-071-1/+2
|
* DeliverToUser(): Since most calls to this function are on internallybwarsaw2000-09-181-0/+1
| | | | | | | | created messages, explicitly set the 'noack' flag to true so that by default, Replybot will ignore the message. This will get overridden by the flag set in qrunner (which is the only place that externally generated messages are injected into the system using DeliverToUser()). Closes SF bug #114603.
* do_pipeline(): Added a failsafe around the delivery module's process()bwarsaw2000-06-231-1/+5
| | | | | call. If the module does a fork, and the child process returns here, we exit immediately.
* do_pipeline(): Factored out from DeliverToList().bwarsaw2000-06-201-5/+12
| | | | | | | | | DeliverToList(): Handle `_enqueue_immediate' by bypassing the call to do_pipeline and enquing the message immediately to disk. Still maintains the same interface to the outside world. Also, copy the pipeline list regardless of whether it comes from LIST_PIPELINE or from msgdata.
* MessageHeld.rejection_notice(): New method which subclasses overridebwarsaw2000-06-151-0/+8
| | | | to provide a better rejection notice suggestion in the admindb page.
* Convert all uses of mlist.LogMsg() to the new syslog() interface.bwarsaw2000-06-021-2/+3
|
* DeliverToList(): When the parameter msgdata has no 'pipeline' key, webwarsaw2000-06-011-1/+1
| | | | | | must make a copy of LIST_PIPELINE, otherwise subsequent calls to DeliverToList() do nothing... e.g. qrunner on multiple message deliveries.
* DeliverToList(): Use mm_cfg.DELIVERY_RETRY_PERIOD instead of abwarsaw2000-05-311-5/+12
| | | | | | | | hardcoded value. Also, if delivery retries expire, don't just trash the message; delete the first entry on the pipeline (which should always be the delivery module) and continue with pipeline processing.
* DeliverToList(): If any pipeline module fails, enqueue the message.bwarsaw2000-05-221-1/+4
| | | | | | This means that clients of this interface normally don't need to check the return value. Only cron/qrunner checks the return value (which is now just a boolean) to know whether it can dequeue the message or not.
* DeliverToList(): Take out debugging prints.bwarsaw2000-05-221-3/+0
| | | | | DeliverToUser(): Don't set `recips' key in the dictionary definition, since it's set conditionally below that.
* DeliverToUser(): This needs to occasionally take a newdata argumentbwarsaw2000-05-081-1/+5
| | | | for update()'ing into the message metadata.
* Many changes to make message delivery more robust in the face ofbwarsaw2000-05-081-34/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* pipeline_delivery(): factoring out common delivery code.bwarsaw2000-03-281-15/+23
| | | | | | | DeliverToList(), DeliverToUser(): Use pipeline_delivery RedeliverMessage(): New delivery top-level function which is used by qrunner to attempt re-delivery.
* Update the copyright lines to include the years 1999 & 2000.bwarsaw2000-03-211-1/+1
|
* DeliverToUser(): 'fastrack' => 'fasttrack'bwarsaw2000-03-031-1/+1
|
* DeliverToList(): Added the Replybot module, just before the Holdbwarsaw2000-02-191-1/+3
| | | | | | module. DeliverToUser(): Add the Replybot module as the first in the list.
* HandlerError: base class should be Errors.MailmanErrorbwarsaw1999-12-091-1/+2
|
* Get DELIVERY_MODULE from mm_cfg.py. Makes for easier customization.bwarsaw1999-11-301-9/+4
|
* Parameterize the message delivery module used.bwarsaw1999-11-301-2/+9
|
* process() => DeliverToList()bwarsaw1999-11-241-1/+19
| | | | | | | | | | | DeliverToUser(): New function which implements a pipeline for direct delivery to a specified user. This pipeline is used for all admin notifications, and other things like user post acks. It sets msg.fastrack attribute to 1 so other modules can know which delivery track this message is on. This lets us use the same module for all delivery, or separate ones for delivery to list and delivery to user.
* """Contains all the common functionality for the msg handler API."""bwarsaw1999-11-101-0/+51