summaryrefslogtreecommitdiff
path: root/Mailman/Handlers/Hold.py
Commit message (Collapse)AuthorAgeFilesLines
...
* All classes should use the renamed base class: Errors.MessageHeld =>bwarsaw2001-07-101-10/+10
| | | | Errors.HoldMessage.
* Better syslog() calling conventions.bwarsaw2001-06-271-1/+1
|
* process(): Check for administrivia as the first hold test. Thisbwarsaw2001-05-311-5/+5
| | | | change is a candidate for 2.0.6.
* hold_for_approval(): We want the admin notification message to appearbwarsaw2001-05-311-4/+9
| | | | | | | | | to come from the list owner to avoid any unnecessary bounce processing. Also, and more importantly, set the message's metadata "tomoderators" flag so that the admin notification message will be sent to both the list owners and the list moderators.
* hold_for_approval(): In addition to passing in the user's preferredbwarsaw2001-05-181-4/+2
| | | | | language, also pass in the MailList object; maketext() digs the preferred language out of the list object.
* Lots of i18n changes. Specifically,bwarsaw2001-03-021-33/+53
| | | | | | | | | | | | | | | | | | | We have to play module global footsie with _() so that the rejection notices are marked as translatable, but aren't actually translated until later. Administrivia.rejection_notice(), MessageTooBig.rejection_notice(): Convert to interpolating local variables. hold_for_approval(): Conversion to the new way of i18n'ing. The language context at this point is the user's preferred language, so we craft his notification first before temporarily changing contexts to the list's preferred (for the admin). We no longer need to duplicate the code as was done before, but some things need to be re-translated in the context of the list's preferred language. Also, translate the exception str() and rejection_notice for real here.
* hold_for_approval(): Fix the Utils.maketext() calls to pass thebwarsaw2001-02-281-1/+1
| | | | language in as a keyword argument.
* Conversion to mimelib.bwarsaw2001-02-151-45/+46
| | | | | | | | | | | | De-string-module-ify Other Python 2.0 constructs used where appropriate. All exceptions now use Errors.MessageHeld as their base class (MessageHeld was moved from the obsolete HandlerAPI module to the Errors module). Remove the pickle imports.
* Latest set of I18N patches from jcrey. Specifically,bwarsaw2000-12-261-19/+34
| | | | | | | | | | | Exception classes: Mark the `rejection' strings for translation, but don't similarly mark the class docstrings. pygettext.py is able to extract these strings without markings. hold_for_approval(): Other changes to support I18N include setting $LANG to list's preferred language; marking more strings as translatable. There's duplicate code here which can be refactored much better.
* process(): Get rid of the string module in favor of string methods.bwarsaw2000-12-201-7/+7
| | | | | Also, use list comprehensions instead of map where appropriate. And, wrap translatable strings in _().
* Administrivia.rejection_notice(), hold_for_approval():bwarsaw2000-08-011-2/+2
| | | | GetAbsoluteScriptURL() => GetScriptURL(..., absolute=1)
* Administrivia.__doc__: Fixed typo (closes SF bug# 108128).bwarsaw2000-06-231-1/+1
|
* process(), hold_for_approval(): The clue that the message has comebwarsaw2000-06-231-2/+2
| | | | | | | | from the gate_news cronjob is that the msgdata dictionary will contain a `fromusenet' key. This was erroneously checking the msg object for the `fromusenet' attribute (as was the case with the old interface), which caused notifications to go to Usenet posters whose messages were held. Bogus!
* All MessageHeld derived classes now include a rejection string, whichbwarsaw2000-06-151-14/+31
| | | | | | | | | | | | | | | | | | is used instead of the hardcoded string in the `reject explanation' field of the admindb page. This means that the default rejection notices are more closely tailored to the type of hold put on the message. Most are simple strings, although Administrivia and MessageTooBig have more elaborate rejection_notice() methods to give some program supplied details. MessageTooBig holds also now include both the message body length and the list-specific maximum body size in the hold reason. hold_for_approval(): The rejection notice is placed in the msgdata['rejection-notice'] key for extraction by the admindb.py script.
* Convert all uses of mlist.LogMsg() to the new syslog() interface.bwarsaw2000-06-021-3/+4
| | | | process(): The argument to GetSender() is `use_envelope'.
* Many changes to make message delivery more robust in the face ofbwarsaw2000-05-081-18/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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(): Use only msg.GetSender() as the way to get the "author"bwarsaw2000-03-031-4/+2
| | | | | | address of the message. GetEnvelopeSender() no longer exists (and GetSender() keys off of USE_ENVELOPE_SENDER, so it still has the same basic functionality).
* process(): when checking mlist.posters, be sure to lowercase allbwarsaw2000-02-181-2/+2
| | | | | addresses since the matching inside FindMatchingAddresses() are lowercased.
* NotExplicitlyAllowed: New class to represent message hold conditionsbwarsaw2000-02-181-1/+13
| | | | | | | | | | described below. process(): When members_posting_only is not set, but posters /is/ set, the semantics are that only those explicitly listed in posters can post without admin approval. Even though I think this is AFU'd, at least this patch fixes things so it works the same as it did in Mailman 1.1.
* hold_for_approval(): When admin_immed_notify is false, the subjectbwarsaw1999-12-111-0/+1
| | | | | variable wouldn't get defined for responses to the sender. (Ricardo Kustner).
* If messages originate from Usenet, do not hold them for implicitbwarsaw1999-12-101-2/+6
| | | | destination.
* hold_for_approval(): Don't send the author of the message abwarsaw1999-12-091-1/+2
| | | | | | notification if a message originating on Usenet is held for approval, even if dont_respond_to_post_requests is false. They had no idea their message was appearing on a mailing list!
* hold_for_approval(): Do the sending of postheld notification to thebwarsaw1999-11-241-12/+17
| | | | user here and not in the post script.
* Convert message delivery to pipeline architecture by usingbwarsaw1999-11-241-6/+8
| | | | | | | | HandlerAPI.DeliverToUser() for fast track delivery of the acknowledgement to the sender. We need to be a little tricky digging the original sender out of a msg object attribute, since CookHeaders (which sets the attribute) changes it for the outgoing message. If msg.original_sender isn't found, use the normal msg.GetSender().
* New pipeline delivery modulebwarsaw1999-11-101-0/+196
"""Determine whether this message should be held for approval. This modules tests only for hold situations, such as messages that are too large, messages that have potential administrivia, etc. Definitive approvals or denials are handled by a different module. If no determination can be made (i.e. none of the hold criteria matches), then we do nothing. If the message must be held for approval, then the hold database is updated and any administator notification messages are sent. Finally an exception is raised to let the pipeline machinery know that further message handling should stop. """