summaryrefslogtreecommitdiff
path: root/Mailman/Handlers/Acknowledge.py
Commit message (Collapse)AuthorAgeFilesLines
* Reorganize doctests, moving handler documentation into Mailman/handlers/docs.Barry Warsaw2008-01-241-65/+0
| | | | Rename all handlers to be more PEP 8 friendly, i.e. lowercased.
* Remove both the model and interface for RosterSets. These are no longer usedBarry Warsaw2007-06-181-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | or necessary in the current data model. Convert the test_handlers.py Python test to an acknowledge.txt doctest, and make the Acknowledge.py handler work with the new data model. There are a few XXX comments left in here due to the fact that the web stuff is a total hack in the current branch currently. Added IMailingListWeb methods and properties to the MailingList model class: web_host and script_url(). Work out how IMembers will expose the lookup-order based preferences. By getting the attribute IMember.preferences you can see exactly the preferences overridden by this member. To use the lookup order, use IMember.delivery_mode, IMember.acknowledge_posts, etc. IOW, the IMember interface now provides the properties directly and access through this mechanism supports lookup order with definitive preference values. Also added IMember.unsubscribe() which does the obvious, and IMember.options_url() which is a total hack for providing a url (but not the ultimately right one) for the user's option page. Refactor the model's roster classes. Also added IRoster.get_member() method with efficient queries to return the right results. Make AdministratorRoster.members more efficient due to a better query. Update the membership.txt doctest to eliminate a chance ordering effect, and also to test finding members with .get_member(). The clean up section uses the new .unsubscribe() method.
* Test suite repair. All tests are now passing again.bwarsaw2007-03-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - In i18n.py, change this method so that everything it returns will be guaranteed to be a unicode. Mailman 2.2 will be unicode-safe, meaning all strings internally will be unicodes. The translation service is one boundary point were strings come from the outside, so ensure that they are unicodes and convert if necessary. This may break some things, but it's better to fix those situations than to continue to return 8-bit strings from _(). - In Mailman/testing/base.py, craft a fake module called Mailman.MTA.stub and stick no-op functions on stub.create() and stub.remove(). We really don't need the MTA modules for testing purposes (yet at least), and if you're using the default configuration, you'll get tons of cruft on stdout when the Manual MTA tries to add and remove mailing lists. Set up the test configuration environment to use this stub MTA module. - In test_handlers.py, remove an extraneous str(). - Convert ToDigest.py, Hold.py and Acknowledge.py to __i18n_templates__. (I'm pretty darn close to just making everything use $-strings by default.) - In CookHeaders.py, there's no need to unicode()-ify the subject since that should already be a unicode when passed from _(). - In MailList.py, we can use the str.capitalize() method.
* Update copyright years.bwarsaw2007-01-191-1/+1
|
* Fix test_message.py by finishing the wind-through of the configuration objectbwarsaw2006-07-081-9/+10
| | | | | | | | | | | | | | | | 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 porting from 2.1.6tkikuchi2005-08-281-1/+1
|
* FSF office has moved. chdcking in for MAIN branch.tkikuchi2005-08-271-1/+1
|
* process(): Might as well add a link to the member's preferences page.bwarsaw2002-08-151-1/+2
|
* process(): Mentor Cana reports a crash when the subject header is anbwarsaw2002-08-101-10/+4
| | | | | | | | | | | email.Header.Header instance; it won't have a .startswith() method. The real problem is that the attempt to send back the original, non-prefixed header was way too naive. Fortunately, the msgdata will contain the original subject if it was munged, so just use that. Question: should we try to send back the decoded header?
* GetAdminEmail() eradication campaign.bwarsaw2002-03-261-1/+1
| | | | | | | process(), hold_for_approval(), do_discard(): Make the notification email appear to come from the -bounces address. When the sender is for human consumption, make it the -owner address (or in the case of Cleanse.py for anonymous lists, the list posting address).
* process(), hold_for_approval(), do_discard(): When creating thebwarsaw2002-02-111-4/+2
| | | | | | | | UserNotification message object, pass in the language that the message should be in. This allows us to get the character set and header encodings right. Patch by Ben Gertzfield.
* Convert from mimelib to email.bwarsaw2001-10-011-2/+4
| | | | | | process(): Fixed buglet so that if there is no Subject: header in the original message, "(no subject)" -- properly i18nified -- will be used instead of "None".
* process(): NotAMember -> NotAMemberErrorbwarsaw2001-08-011-1/+1
|
* All membership related attribute access should use the MemberAdaptorbwarsaw2001-07-191-28/+33
| | | | | | | | | | | | API instead, e.g. GetUserOption() -> getMemberOption() GetPreferredLanguage() -> getMemberLanguage() IsMember() -> isMember() GetDigestDeliveryMembers() -> getDigestMemberKeys() ToDigest.py: clear the one_last_digest() dictionary after sending the digest.
* process(): In addition to passing in the user's preferred language,bwarsaw2001-05-181-1/+1
| | | | | also pass in the MailList object; maketext() digs the preferred language out of the list object.
* process(): More i18n changes. The user's preferred language is passedbwarsaw2001-03-021-5/+6
| | | | | | | around via the message metadata key `lang' (set by the Runner). Use this language to get the proper postack.txt template. Also be sure to set the Content-Type: header on the message we're generating and sending back to the user.
* Add missing importbwarsaw2001-02-281-0/+1
|
* Conversion to mimelib.bwarsaw2001-02-151-11/+13
| | | | | | | | De-string-module-ify Other Python 2.0 constructs used where appropriate. Get rid of HandlerAPI references -- this module is obsolete.
* Latest set of I18N patches from jcrey. Specifically,bwarsaw2000-12-261-1/+4
| | | | | process(): set $LANG to the list's preferred language, and also pass this into the maketext() call.
* process(): Use string method startswith().bwarsaw2000-12-201-3/+2
|
* First round integration of Juan Carlos's translatable string markings.bwarsaw2000-12-071-2/+3
|
* process(): GetAbsoluteScriptURL() => GetScriptURL(..., absolute=1)bwarsaw2000-08-011-1/+1
|
* Many changes to make message delivery more robust in the face ofbwarsaw2000-05-081-2/+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
|
* AcknowlegePosts => AcknowledgePostsbwarsaw1999-11-241-12/+17
| | | | | | | | | Convert message delivery to pipeline architecture by using 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/+50
"""Send an acknowledgement of the successful post to the sender. This only happens if the sender has set their AcknowlegePosts attribute. This module must appear after the deliverer in the message pipeline in order to send acks only after successful delivery. """