diff options
| author | bwarsaw | 2002-04-10 04:50:56 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-04-10 04:50:56 +0000 |
| commit | 35878789da911e48d8424b4b3bd3cff89809c7fb (patch) | |
| tree | 90ed69e55d7981a38132066627cd78a679232fa7 | |
| parent | 8de0d70abbfdac477c9bc9874f3d0ef200b87773 (diff) | |
| download | mailman-35878789da911e48d8424b4b3bd3cff89809c7fb.tar.gz mailman-35878789da911e48d8424b4b3bd3cff89809c7fb.tar.zst mailman-35878789da911e48d8424b4b3bd3cff89809c7fb.zip | |
process(): Port to the email package. Message objects no longer have
a `body' attribute, but we're already getting the flat string of the
message, so we just need to record it's length (since this is all that
we log.
These changes are untested, although they should be correct.
Sendmail.py is highly discouraged anyway, so I don't intend to do any
testing of it.
Closes SF bug #511020
| -rw-r--r-- | Mailman/Handlers/Sendmail.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Mailman/Handlers/Sendmail.py b/Mailman/Handlers/Sendmail.py index 356bd65cb..8940d5680 100644 --- a/Mailman/Handlers/Sendmail.py +++ b/Mailman/Handlers/Sendmail.py @@ -78,6 +78,7 @@ def process(mlist, msg, msgdata): # get all the lines of the message, since we're going to do this over and # over again msgtext = str(msg) + msglen = len(msgtext) # cycle through all chunks failedrecips = [] for chunk in recipchunks: @@ -89,13 +90,13 @@ def process(mlist, msg, msgdata): errcode = (status & 0xff00) >> 8 syslog('post', 'post to %s from %s, size=%d, failure=%d', mlist.internal_name(), msg.get_sender(), - len(msg.body), errcode) + msglen, errcode) # TBD: can we do better than this? What if only one recipient out # of the entire chunk failed? failedrecips.append(chunk) # Log the successful post syslog('post', 'post to %s from %s, size=%d, success', - mlist.internal_name(), msg.get_sender(), len(msg.body)) + mlist.internal_name(), msg.get_sender(), msglen) if failedrecips: msgdata['recips'] = failedrecips raise Errors.SomeRecipientsFailed |
