| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
Rename all handlers to be more PEP 8 friendly, i.e. lowercased.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
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?
|
| |
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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".
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
API instead, e.g.
GetUserOption() -> getMemberOption()
GetPreferredLanguage() -> getMemberLanguage()
IsMember() -> isMember()
GetDigestDeliveryMembers() -> getDigestMemberKeys()
ToDigest.py: clear the one_last_digest() dictionary after sending the
digest.
|
| |
|
|
|
| |
also pass in the MailList object; maketext() digs the preferred
language out of the list object.
|
| |
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
| |
De-string-module-ify
Other Python 2.0 constructs used where appropriate.
Get rid of HandlerAPI references -- this module is obsolete.
|
| |
|
|
|
| |
process(): set $LANG to the list's preferred language, and also pass
this into the maketext() call.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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().
|
|
|
"""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.
"""
|