summaryrefslogtreecommitdiff
path: root/Mailman/Queue
diff options
context:
space:
mode:
authorbwarsaw2002-03-07 22:30:04 +0000
committerbwarsaw2002-03-07 22:30:04 +0000
commitbf83ffa422f0dcc4f5424bec870b442e3b8f94ad (patch)
treef0896adbebb9c5e660eeebb560289accd1c72dc6 /Mailman/Queue
parent533453ea0c54b7b9030c809ad5ec3fece35cd63d (diff)
downloadmailman-bf83ffa422f0dcc4f5424bec870b442e3b8f94ad.tar.gz
mailman-bf83ffa422f0dcc4f5424bec870b442e3b8f94ad.tar.zst
mailman-bf83ffa422f0dcc4f5424bec870b442e3b8f94ad.zip
_dispose(): Consult bounce_unrecognized_goes_to_list_owner before
sending the unrecognized message on to the list owner. In either case, write a log entry to logs/bounce.
Diffstat (limited to 'Mailman/Queue')
-rw-r--r--Mailman/Queue/BounceRunner.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/Mailman/Queue/BounceRunner.py b/Mailman/Queue/BounceRunner.py
index 1bb0c578e..5013b8e77 100644
--- a/Mailman/Queue/BounceRunner.py
+++ b/Mailman/Queue/BounceRunner.py
@@ -75,16 +75,22 @@ class BounceRunner(Runner):
elif self.__scanbounce(mlist, msg):
mlist.Save()
return
- # Otherwise, we should just forward this message to the list
- # owner, because there's nothing we can do with it. Be sure to
- # point the envelope sender at the site owner for any bounces to
- # list owners.
- recips = mlist.owner[:]
- recips.extend(mlist.moderator)
- outq.enqueue(msg, msgdata,
- recips=recips,
- envsender=Utils.get_site_email(extra='admin'),
- )
+ # Does the list owner want to get non-matching bounce messages?
+ # If not, simply discard it.
+ if mlist.bounce_unrecognized_goes_to_list_owner:
+ syslog('bounce', 'forwarding unrecognized, message-id: %s',
+ msg.get('message-id', 'n/a'))
+ # Be sure to point the envelope sender at the site owner for
+ # any bounces to list owners.
+ recips = mlist.owner[:]
+ recips.extend(mlist.moderator)
+ outq.enqueue(msg, msgdata,
+ recips=recips,
+ envsender=Utils.get_site_email(extra='admin'),
+ )
+ else:
+ syslog('bounce', 'discarding unrecognized, message-id: %s',
+ msg.get('message-id', 'n/a'))
finally:
mlist.Unlock()