where do I find the text of a bounce email ?
All,
I am trying to figure why a particular outbound message was bounced, so I'm looking for the text of the NDR that was sent - where do I find that ?
Fyi, the outbound message was accepted by the first relay, and then presumably later bounced by the actual recipient server (Office365).
Any and all hints much appreciated.
-- Per Jessen, Zürich (4.6°C) Member, openSUSE Heroes
On 3/9/21 1:59 AM, Per Jessen wrote:
All,
I am trying to figure why a particular outbound message was bounced, so I'm looking for the text of the NDR that was sent - where do I find that ?
Mailman 2.1 would include the NDR in the notice to the admins when delivery was disabled or bounce score's incremented if those notices were requested. Mailman 3 has no such capability. If you have access to the server, this patch ```
diff --git a/src/mailman/runners/lmtp.py b/src/mailman/runners/lmtp.py index 6a0bdcf5e..eca474089 100644 --- a/src/mailman/runners/lmtp.py +++ b/src/mailman/runners/lmtp.py @@ -217,6 +217,8 @@ class LMTPHandler: slog.debug('%s subaddress: %s, queue: %s', message_id, canonical_subaddress, queue) status.append('250 Ok') + if queue == 'bounces': + config.switchboards['bad'].enqueue(msg, msgdata) except Exception: slog.exception('Queue detection: %s', msg['message-id']) config.db.abort()
will add all received bounces as queue files to var/queue/bad/ where
they can be examined with `mailman qfile`.
--
Mark Sapiro <mark@msapiro.net> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
Mark Sapiro wrote:
diff --git a/src/mailman/runners/lmtp.py b/src/mailman/runners/lmtp.py index 6a0bdcf5e..eca474089 100644 --- a/src/mailman/runners/lmtp.py +++ b/src/mailman/runners/lmtp.py @@ -217,6 +217,8 @@ class LMTPHandler: slog.debug('%s subaddress: %s, queue: %s', message_id, canonical_subaddress, queue) status.append('250 Ok') + if queue == 'bounces': + config.switchboards['bad'].enqueue(msg, msgdata) except Exception: slog.exception('Queue detection: %s', msg['message-id']) config.db.abort()
will add all received bounces as queue files to var/queue/bad/ where they can be examined with `mailman qfile`.
Thanks. Yep, I'm getting NDRs kept now. "mailman qfile" seems to be a bit slow, 2-3 seconds per go. To look for a specific address that bounced, is there any mailman tool for grepping through a collection of bounces? (I have +1200 after a few days). I'm trying with this: find /var/spool/mailman/bad -type f -name \*pck |\ while read m do (mailman qfile $m | grep -q ad.dr@ess) && echo $m done Is there a better way? -- Per Jessen, Zürich (4.6°C) Member, openSUSE Heroes
On 3/16/21 11:34 AM, Per Jessen wrote:
I'm trying with this:
find /var/spool/mailman/bad -type f -name \*pck |
while read m do (mailman qfile $m | grep -q ad.dr@ess) && echo $m doneIs there a better way?
Yes, as you've noticed there is a significant startup cost every time
you invoke the mailman
command. to invoke it only once first see
mailman shell --details
(that refers to mailman withlist
which is just another way to spell
mailman shell
).
You will want to create a script similar to the following:
import pickle from os import listdir
def findaddr(address): for fname in listdir('/var/spool/mailman/bad'): if not fname.endswith('.pck'): continue with open(fname, 'rb') as fp: msg = pickle.load(fp) if address in msg.as_string(): print(fname)
That's your script. Save it as findaddr.py where mailman shell
can
import it and run
mailman shell -r findaddr.py -- ad.dr@ess
This should print the names of any pickles that contain 'ad.dr@ess'
Note however that this may not be necessary. If all you want is the names of the .pck files that mention 'ad.dr@ess',
grep ad.dr@ess /var/spool/mailman/bad/*.pck
should actually work reporting things like
Binary file /var/spool/mailman/bad/*.pck matches
with the actual file name, not *.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Reviving this super old thread b/c it has good Google page rank for "mailman 3 see bounce emails"...
Could this please be added as a config option so we don't have to patch the server code? Seems like a very useful feature for debugging odd bounce behaviors such as I'm doing right now.
Thanks for considering!
-- Tom Smyth (he/him)
On 7/1/23 7:02 AM, Tom Smyth wrote:
Could this please be added as a config option so we don't have to patch the server code? Seems like a very useful feature for debugging odd bounce behaviors such as I'm doing right now.
Starting with Mailman core 3.3.5, bounce DSNs are included in the admin notices. See https://gitlab.com/mailman/mailman/-/issues/737
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (3)
-
Mark Sapiro
-
Per Jessen
-
Tom Smyth