Parse email delivery status notifications (DSN) ?

C

Christopher Arndt

(please CC me in you replies if possible, I am not on the list)

Hi,

I am trying to write a script, that processes bounced emails from our
mailing campaigns to remove them from the distribution list and to
update the customer database.

Since our mailing program is not able to set the "Return-Path" header to
a separate address, but always sets it to the "From" address or the
"Reply-To" (if any), I need a way to distinguish DSNs from normal
replies to that mail box.

Is anybody aware of ready solutions to parse DSNs with Python? I would
just need to check if a mail is a DSN and retrieve the failed email address.

I know, this could probably done with the email module and some regexes,
but I would like to avoid ploughing through RFC 3464 to figure out the
formatting rules, if I can.

A quick search on this list and in the Cookbook, did not turn up
anything useful. I guess, mailman should already have code for this, but
can it be used on it's own?

Any pointers appreciated!

Cheers, Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,141
Latest member
BlissKeto
Top