From 63d2568fe58333f8ca0b7582f74b43e775c581cd Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Thu, 11 Jul 2002 22:14:25 +0000 Subject: send_i18n_digests(): Let's generate MIME digests the correct way, by wrapping each message inside the multipart/digest in a MIMEMessage instance. We also no longer need to initialize the mimedigest instance's payload to the empty list. Also, when sending the digests, be sure to include isdigest=1 in the metadata, otherwise SMTPDirect will try to tack on another footer. --- Mailman/Handlers/ToDigest.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'Mailman/Handlers/ToDigest.py') diff --git a/Mailman/Handlers/ToDigest.py b/Mailman/Handlers/ToDigest.py index caec91de5..02ce5d0c0 100644 --- a/Mailman/Handlers/ToDigest.py +++ b/Mailman/Handlers/ToDigest.py @@ -35,6 +35,7 @@ from email.Parser import Parser from email.Generator import Generator from email.MIMEBase import MIMEBase from email.MIMEText import MIMEText +from email.MIMEMessage import MIMEMessage from email.Utils import getaddresses from Mailman import mm_cfg @@ -268,12 +269,11 @@ def send_i18n_digests(mlist, mboxfp): print >> plainmsg # Now go through and add each message mimedigest = MIMEBase('multipart', 'digest') - mimedigest.set_payload([]) mimemsg.attach(mimedigest) first = 1 for msg in messages: # MIME - mimedigest.attach(msg) + mimedigest.attach(MIMEMessage(msg)) # rfc1153 if first: first = 0 @@ -334,9 +334,13 @@ def send_i18n_digests(mlist, mboxfp): # Zap this since we're now delivering the last digest to these folks. mlist.one_last_digest.clear() # MIME - virginq.enqueue(mimemsg, recips=mimerecips, listname=mlist.internal_name()) + virginq.enqueue(mimemsg, + recips=mimerecips, + listname=mlist.internal_name(), + isdigest=1) # rfc1153 rfc1153msg.set_payload(plainmsg.getvalue()) virginq.enqueue(rfc1153msg, - recips = plainrecips, - listname = mlist.internal_name()) + recips=plainrecips, + listname=mlist.internal_name(), + isdigest=1) -- cgit v1.2.3-70-g09d2