Your post interested me. A few thoughts, if i may, that I hope will repay the interest by at least giving you a place to bounce from.
First of all, if you have to code this yourself, take a look at the Mail::* modules, which should help somewhat in reducing the amount of custom code you have to write.
Next, if you are not already doing so, I would, if possible, create a user that the mailing list was sent as, or if possible, set a custom header in the message (several mailing lists I am on set a Return-Path header, or something similar, with a value related to my subscription to the list). Using this, you could use one of the filtering/sorting mechanisms available as part of several of the Mail::* modules (mentioned above) to act based on seeing that header in a message to either the user the mailing list sent as (root or another).
Hope that helps, and hope others will also contribute useful ideas to you as well.
| [reply] |
FYI, "Reply-To" Munging Considered Harmful. I don't administer a mail server, and I haven't read widely on this, but this article makes sense to me. . . . Maybe I should have started this node like Rod Serling, 'Submitted for your consideration, a mail list adminstrator who munges his headers. But this is no ordinary tale, these headers are being sent from ... The Twilight Zone.' Nah, guess not.
| [reply] |
I read it as you suggested and we don't really want to start munging, I'd like a more universal solution if possible to catch all system errors.
| [reply] |
The problem is, we want to do a more global system, as we have tons of utilities sending out mail and all the bounced mail is landing in root, they have tons of old mail backed up.
I'd like to build both a retroactive and a proactive solution but having problems doing so as nobodys mail server seems to be returning consistently formatted errors.
I'm looking into the idea of seeing if sendmail can remote connect and validate but not having much luck.
Someone suggested:
/usr/lib/sendmail -oeq -bv the@email.com; echo $status
but not returning much of anything useful :(
| [reply] [d/l] |
If you want to process mail error messages, the problem isn't parsing the mail files. The Mail::* modules handle that fine. The problem is processing the bounce messages to figure out the reason for the bounce and the address sent to. I couldn't find any modules in CPAN that do this.
You might want to look at some of the mailing list software written in the Perl. They have to handle processing bounces to remove bad addresses.
| [reply] |
my guess is they embed hidden code into their e-mails, I wanna do a global system admin kind of utility.
| [reply] |
Email::Find
http://search.cpan.org/author/MIYAGAWA/Email-Find-0.09/lib/Email/Find.pm
Save me, St.Perldoc! | [reply] |
With find what would be the code sample to have it consistently pull the correct errors as theres a thousand and one ways these errors come back??
Thanks to everyone so far for the great replies I appreciate it.
| [reply] |