summaryrefslogtreecommitdiff
path: root/Mailman/Handlers/CalcRecips.py
Commit message (Collapse)AuthorAgeFilesLines
* Reorganize doctests, moving handler documentation into Mailman/handlers/docs.Barry Warsaw2008-01-241-128/+0
| | | | Rename all handlers to be more PEP 8 friendly, i.e. lowercased.
* Reorganize the enums so that they live in the most appropriate interface. TheBarry Warsaw2007-10-091-1/+1
| | | | only constant left in Mailman.constants is now actually a constant.
* Convert the tests for the CalcRecips handler to doc tests. There areBarry Warsaw2007-06-191-19/+11
| | | | | | | | | | | | | | | | | some XXX's in the doc test because digest recipients aren't tested (though those may go in a different doctest), and neither are urgent messages. This latter is for the same reason that the Approved handler is not yet tested; which password do you use in that header? The CalcRecips tests would also seem the natural place to test the receive_list_copy preference, but that actually gets processed in the AvoidDuplicates handler, so it isn't tested here. Add delivery_status (of type enum DeliveryStatus) to preferences. I'm not entirely sure that's the right place for it, but it lets me finish converting the test for now. Expose the rest of the preferences through the IMember interface.
* 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
* - Cgi/options.py - fixed to not present the "empty" topic to user.msapiro2006-05-171-0/+4
| | | | - Handlers/CalcRecips.py - Changed to not process topics if topics are disabled for the list.
* - Convert all logging to Python's standard logging module. Get rid of allbwarsaw2006-04-171-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* FSF office has moved. chdcking in for MAIN branch.tkikuchi2005-08-271-1/+1
|
* do_topic_filters(): Rearrange if clauses for clarity.bwarsaw2002-04-111-18/+17
|
* Update copyright years.bwarsaw2002-03-161-1/+1
|
* process(): Use getDeliveryStatus().bwarsaw2001-12-191-1/+2
|
* process(): Forgot to include a realname local var.bwarsaw2001-10-221-0/+1
|
* RejectUrgentMessage: Remove this since the base class, RejectMessage,bwarsaw2001-10-091-22/+5
| | | | | | | is fine for our needs. process(): Raise RejectMessage instead, and use the rejection text as the value of the exception.
* Convert from mimelib to email.bwarsaw2001-10-011-3/+4
| | | | | process(): Also, use the MembershipAdaptor API for calculating the recipients of an urgent message.
* cosmeticbwarsaw2001-08-031-1/+0
|
* do_topic_filters(): Another step towards conversion to MemberAdaptorbwarsaw2001-07-291-2/+2
| | | | API. getMemberTopics()
* process(): Fixed typo (should have been "getMemberOption" notbwarsaw2001-07-191-1/+1
| | | | "getUserOption"). Found by Mentor Cana.
* process(): Use the MemberAdaptor API. Also, call do_topic_filters()bwarsaw2001-07-191-17/+65
| | | | | | | | | | | to further cull the recipients. do_topic_filters(): For each recipient of the regular delivery message, if there are no topic hits, check the ReceiveNonmatchingTopics option to see whether this recipient should get the message. If there are topic hits, remove the recipient unless they've indicated an interest in this topic (or they haven't specified any interests).
* Added support for an Urgent: header, which should contain a passwordbwarsaw2001-07-101-0/+47
| | | | | | | | | | | | | | | | | | (either the list administrator's, or the list moderator's). If the message contains this header with a matching password, the message is sent to the entire list membership immediately, even to those members who receive the message via digests. Note that the message /is/ still digested too. Specifically, RejectUrgentMessage: New class, derived from RejectMessage, which is raised if the password in the Urgent: header does not match. Thus, the original message is returned to the sender immediately, and is not held or posted. process(): Check Urgent: for a matching list moderator's or list administrator's header. If found, set the recipients list to both the regular and digest delivery members. If Urgent: is found, but the password doesn't match, bounce the message back to the sender.
* Conversion to mimelib.bwarsaw2001-02-151-7/+7
| | | | | | | | De-string-module-ify Other Python 2.0 constructs used where appropriate. Get rid of HandlerAPI references -- this module is obsolete.
* process(): List comprehensions are fun!bwarsaw2000-12-201-4/+2
|
* Many changes to make message delivery more robust in the face ofbwarsaw2000-05-081-5/+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
|
* Remove the ack_posts stuff, since this is now done in the Acknowledgebwarsaw1999-11-241-5/+2
| | | | module.
* process(): Yikes! Don't calculate recipients if the msg objectbwarsaw1999-11-161-0/+4
| | | | | | already has a recipients list, otherwise digests will get delivered to all non-digest members (and digest members won't even get the message at all!)
* New pipeline delivery modulebwarsaw1999-11-101-0/+55
"""Calculate the regular (i.e. non-digest) recipients of the message. This module calculates the non-digest recipients for the message based on the list's membership and configuration options. It places the list of recipients on the `recips' attribute of the message. This attribute is used by the SendmailDeliver and BulkDeliver modules. """