diff options
| author | bwarsaw | 2000-09-15 17:20:11 +0000 |
|---|---|---|
| committer | bwarsaw | 2000-09-15 17:20:11 +0000 |
| commit | e103b37edd4a7f7eb9c414ecf2a4666543527055 (patch) | |
| tree | 221a0660999646147afc8c565541d09d21e21a97 | |
| parent | cc25cc1df659fd2990bdfb2d8490245d4e7831f6 (diff) | |
| download | mailman-e103b37edd4a7f7eb9c414ecf2a4666543527055.tar.gz mailman-e103b37edd4a7f7eb9c414ecf2a4666543527055.tar.zst mailman-e103b37edd4a7f7eb9c414ecf2a4666543527055.zip | |
inject_digest(): Only send a mime digest if there actually are mime
recipients. Likewise for plain text digests.
| -rw-r--r-- | Mailman/Handlers/ToDigest.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Mailman/Handlers/ToDigest.py b/Mailman/Handlers/ToDigest.py index 168489bb8..5f1f5e618 100644 --- a/Mailman/Handlers/ToDigest.py +++ b/Mailman/Handlers/ToDigest.py @@ -166,13 +166,16 @@ def inject_digest(mlist, digestfile, topicsfile): digest = Digest(mlist, topicsdata, fp.read()) # Generate the MIME digest, but only queue it for delivery so we don't # hold the lock too long. - msg = digest.asMIME() - msg['To'] = mlist.GetListEmail() - msg.Enqueue(mlist, recips=mime_recips, isdigest=1, approved=1) - # Generate the RFC934 "plain text" digest, and again, just queue it - msg = digest.asText() - msg['To'] = mlist.GetListEmail() - msg.Enqueue(mlist, recips=text_recips, isdigest=1, approved=1) + if mime_recips: + msg = digest.asMIME() + msg['To'] = mlist.GetListEmail() + msg.Enqueue(mlist, recips=mime_recips, isdigest=1, approved=1) + if text_recips: + # Generate the RFC934 "plain text" digest, and again, just queue + # it + msg = digest.asText() + msg['To'] = mlist.GetListEmail() + msg.Enqueue(mlist, recips=text_recips, isdigest=1, approved=1) # zap accumulated digest information for the next round os.unlink(digestfile) os.unlink(topicsfile) |
