The attached patch improves the content of the bounce log, determining the message-id of the bounced message.
This should make it possible for mmdsr or similar tools to determine what percentage of e-mails bounced.
The patch also exercises the message-id code in test_bounces.py. Currently it fails because some of the messages in tests/bounces/ have mbox-style 'From ' lines,
and this seems to make email.Message ignore the headers; this causes test_bounces.py to fail at the moment after the patch is applied.
Updated version of the patch
Logged In: YES
user_id=11375
Originator: YES
Here's an updated version of the patch that leaves the <> characters in message-ids, and updates the tests correspondingly.
File Added: bounce-log-2.txt
Logged In: YES
user_id=11375
Originator: YES
The bounce-analysis branch on Launchpad includes this patch, plus a contrib/ script that analyzes Mailman and Postfix logs to produce a delivery report. See https://code.launchpad.net/~amk/mailman/bounce-analysis
I believe the branch can be merged into the Mailman 2.2. (We probably don't want to change the log formats in the 2.1.x series.)