A very useful patch (against 2.1.11rc1)
--- Mailman/Queue/BounceRunner.save.py 2008-06-20 19:34:51.000000000 +0200 +++ Mailman/Queue/BounceRunner.py 2008-06-20 19:35:44.000000000 +0200 @@ -230,7 +230,8 @@ class BounceRunner(Runner, BounceMixin): # If that still didn't return us any useful addresses, then send it on # or discard it. if not addrs:
syslog('bounce', 'bounce message w/no discernable addresses: %s',
syslog('bounce', 'bounce message to %s w/no discernable
addresses: %s',
mlist.internal_name(),
msg.get('message-id'))
maybe_forward(mlist, msg)
return
-- Fil
Oh yeah!!! I did that one a while ago!
Bob
---------- Original Message ----------- From: Fil fil@rezo.net To: "Mailman Developers" mailman-developers@python.org Sent: Fri, 20 Jun 2008 19:48:14 +0200 Subject: [Mailman-Developers] better logging of undiscernable bounces
A very useful patch (against 2.1.11rc1)
--- Mailman/Queue/BounceRunner.save.py 2008-06-20 19:34:51.000000000 +0200
+++ Mailman/Queue/BounceRunner.py 2008-06-20 19:35:44.000000000 +0200 @@ -230,7 +230,8 @@ class BounceRunner(Runner, BounceMixin): # If that still didn't return us any useful addresses, then send it on # or discard it. if not addrs: - syslog('bounce', 'bounce message w/no discernable addresses: %s', +
syslog('bounce', 'bounce message to %s w/no discernable addresses: %s', + mlist.internal_name(),
msg.get('message-id')) maybe_forward(mlist, msg)
return-- Fil
------- End of Original Message -------
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Jun 20, 2008, at 1:48 PM, Fil wrote:
A very useful patch (against 2.1.11rc1)
--- Mailman/Queue/BounceRunner.save.py 2008-06-20
19:34:51.000000000 +0200 +++ Mailman/Queue/BounceRunner.py 2008-06-20
19:35:44.000000000 +0200 @@ -230,7 +230,8 @@ class BounceRunner(Runner, BounceMixin): # If that still didn't return us any useful addresses, then
send it on # or discard it. if not addrs:
syslog('bounce', 'bounce message w/no discernable
addresses: %s',
syslog('bounce', 'bounce message to %s w/no discernable
addresses: %s',
mlist.internal_name(), msg.get('message-id')) maybe_forward(mlist, msg) return
Seems reasonable to me! +1
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Barry Warsaw wrote: | On Jun 20, 2008, at 1:48 PM, Fil wrote: | |> A very useful patch (against 2.1.11rc1) | | |> --- Mailman/Queue/BounceRunner.save.py 2008-06-20 19:34:51.000000000 |> +0200 |> +++ Mailman/Queue/BounceRunner.py 2008-06-20 19:35:44.000000000 |> +0200 |> @@ -230,7 +230,8 @@ class BounceRunner(Runner, BounceMixin): |> # If that still didn't return us any useful addresses, then |> send it on |> # or discard it. |> if not addrs: |> - syslog('bounce', 'bounce message w/no discernable |> addresses: %s', |> + syslog('bounce', 'bounce message to %s w/no discernable |> addresses: %s', |> + mlist.internal_name(), |> msg.get('message-id')) |> maybe_forward(mlist, msg) |> return | | Seems reasonable to me! | +1
My suggestion is a bit different. The patch is attached, but I'm not completely sure about it.
I have changed Fil's log message from
'bounce message to %s w/no discernable addresses: %s'
to
'%s: bounce message w/no discernable addresses: %s'
This is both to make it more consistent with other bounce log messages and to avoid mangling the existing string in case someone's log analysis is looking for it.
The part I'm not sure about is adding the list name to the '(forwarding|discarding) unrecognized' messages. One or the other of these is always written immediately after the 'bounce message w/no discernable addresses' message, so the list name isn't really required since the list will be identifiable with the first change, and it may even seem redundant, but I think it's more consistent to include it on all the messages.
Other thoughts?
Mark Sapiro mark@msapiro.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
=== modified file 'Mailman/Queue/BounceRunner.py' --- Mailman/Queue/BounceRunner.py 2007-11-19 20:30:51 +0000 +++ Mailman/Queue/BounceRunner.py 2008-06-21 02:39:32 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2006 by the Free Software Foundation, Inc. +# Copyright (C) 2001-2008 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -227,8 +227,10 @@ # If that still didn't return us any useful addresses, then send it on # or discard it. if not addrs:
syslog('bounce', 'bounce message w/no discernable addresses: %s',
msg.get('message-id'))
syslog('bounce',
'%s: bounce message w/no discernable addresses: %s',
mlist.internal_name(),
msg.get('message-id', 'n/a'))
maybe_forward(mlist, msg)
return
# BAW: It's possible that there are None's in the list of addresses,
@@ -330,8 +332,12 @@ """), subject=_('Uncaught bounce notification'), tomoderators=0)
syslog('bounce', 'forwarding unrecognized, message-id: %s',
syslog('bounce',
'%s: forwarding unrecognized, message-id: %s',
mlist.internal_name(),
msg.get('message-id', 'n/a'))
else: syslog('bounce', 'discarding unrecognized, message-id: %s',
syslog('bounce',
'%s: discarding unrecognized, message-id: %s',
mlist.internal_name(),
msg.get('message-id', 'n/a'))
Mark Sapiro writes:
discernable addresses' message, so the list name isn't really required since the list will be identifiable with the first change, and it may even seem redundant, but I think it's more consistent to include it on all the messages.
+1 +1
Consistency and (some) redundancy is good in logs.
'%s: bounce message w/no discernable addresses: %s'
You are right it's more consistent
The part I'm not sure about is adding the list name to the '(forwarding|discarding) unrecognized' messages. One or the other of these is always written immediately after the 'bounce message w/no discernable addresses' message, so the list name isn't really required since the list will be identifiable with the first change, and it may even seem redundant, but I think it's more consistent to include it on all the messages.
I agree; it will make grepping a listname much easier
-- Fil