And verily didst John P. Rouillard spake of these matters:
> In message <9406282124.AA13848@us4rmc.pko.dec.com>, Jim Reisert --
> MLO5-2/36A -- DTN 223-5747 28-Jun-1994 1724 writes:
> >I have 1.92. I'm using resend. Is there a way to handle bounces
> >automatically - i.e. if a message bounces, have MajorDomo automatically
> >move the address from the list to the bounces list? Or does it all have to
> >be done by hand (i.e. by sending a BOUNCE command to MajorDomo)?
>
> The short answer is no, sorry.
>
> (Standing out on limb) I claim there will never be a program invented
> that can decipher the crap that some mailers pass back as a bounced
> message.
Well, John, the timing is absolutely perfect. I'm pulling out my
pruning saw...
Announcing the Majordomo AutoBounce program!
Believe it or not, I have actually written a program to automatically
handle bounces. Really, I'm not kidding.
While there will never be a program to decipher *all* the crazy
formats out there, there are many that follow a pattern. And let's
face it, 80% are from sendmail in one version or another.
Most bounces follow a general pattern. They usually come from
the same user name on a system, with the same subject. They
have a section of the message with the error message and rejected
address, and a section with the rejected message.
If you can codify these parameters for a few common mailers, and check
the bounced message against them, you can pick out the address from
the message. Double-check the address to make sure it is a list
member, and if it is, bounce it!
I've been running my autobounce program for about a week now, so
I'm still considering it in a beta-test phase. So far I have
created profiles for the following mailers' bounce messages:
# sendmail
# Microsoft Mail for PC networks
# SMail 3
# LMail
# PMDF
# IBM VM Batch SMTP mailer
# America On-Line service
# MCI Mail service
# CompuServe users
To install it, you need to have the program read the bounce messages
that are returned to the list sender. This is generally specified
by the "-f" on "resend". So instead of specifying "-f listname-owner"
or similar human address, I have both a human and the program
get the bounces like this:
#----------------------------------------------------------
listname: "|/usr/local/mail/majordomo/wrapper resend \
-l listname -f listname-sender -s listname-outgoing"
listname-sender: listname-owner, listname-autobounce
listname-autobounce: "|/usr/local/mail/majordomo/wrapper \
autobounce -l listname"
#----------------------------------------------------------
When a bounce comes back to listname-sender, it gets piped to
the autobounce program. The autobounce program reads the
message line by line, comparing it to its known mailer profiles.
If anything matches, the address is checked to see if it is on
the list. Note that there is a separate listname-autobounce alias
for each list which passes the list name to the autobounce program.
That way the scope of possibilities is much narrower, and we are
more likely to get good results because we can check to make sure
what we think is the bouncing address really is a list member.
That way spurious garbage is safely ignored.
After all that, a message is mailed to Majordomo with the unsubscribe
command for the list and a subscribe command for the bounces list.
You can specify any list name for the bounces list, in case you want
to have separate ones or whatever. Or you can tell it just to unsub
but not add to any bounces list.
I chose to do the commands by mail on purpose. That way, any local
customizations to Majordomo in the subscribe or unsubscribe process do
not need to be recreated in the autobounce program. It also helps
it remain relatively version-independent and de-coupled as much as
possible. It does expect to read the listname.passwd files and
the majordomo.cf for a few things, but that's about it.
My production system is still running 1.62, so that's all I've tested
it on. I'm upgrading to 1.92 this week, so I'll post the program
here after I've checked it out on 1.92 next week.
One thing the program needs is a good way of specifying the bounce
message profiles so they can be easily added to. Right now it
looks like this:
#-------------------------------------
# NOTE: Make sure the bounce_left pattern starts with ^ and
# bounce_right ends with $ anchors!
#
# Back-quoted metacharacters need a double backslash.
#-------------------------------------
# Most versions of sendmail
$bounce_from{"sendmail"} = "mail delivery subsystem";
$bounce_subject{"sendmail"} = "returned mail";
$bounce_startline{"sendmail"} = "^ *-+ *transcript of session";
$bounce_endline{"sendmail"} = "^ *-+ *unsent message";
$bounce_left{"sendmail"} = "^ *5[0-9]+ *";
$bounce_right{"sendmail"} = "[.][.][.].*$";
#-------------------------------------
# Microsoft Mail for PC networks
$bounce_from{"ms-mail"} = "admin";
$bounce_subject{"ms-mail"} = "mail failure";
$bounce_startline{"ms-mail"} = "following unknown address";
$bounce_endline{"ms-mail"} = "---+";
$bounce_left{"ms-mail"} = "^ *[a-z0-9/]+/";
$bounce_right{"ms-mail"} = " *$";
#-------------------------------------
# SMail 3
$bounce_from{"smail3"} = "mailer-daemon";
$bounce_subject{"smail3"} = "mail failed";
$bounce_startline{"smail3"} = "failed addresses follow";
$bounce_endline{"smail3"} = "message text follow";
$bounce_left{"smail3"} = "^ *";
$bounce_right{"smail3"} = "[.][.][.].*$";
#-------------------------------------
# LMail
$bounce_from{"lmail"} = "lmail";
$bounce_subject{"lmail"} = "undeliver";
$bounce_startline{"lmail"} = "error description";
$bounce_endline{"lmail"} = "^ *error-end:";
$bounce_left{"lmail"} = "^ *error-for: *";
$bounce_right{"lmail"} = " *$";
#-------------------------------------
# PMDF
$bounce_from{"pmdf"} = "pmdf";
$bounce_subject{"pmdf"} = "undeliver";
$bounce_startline{"pmdf"} = "could not be delivered";
$bounce_endline{"pmdf"} = "^ *reason:";
$bounce_left{"pmdf"} = "^ *addressee: *";
$bounce_right{"pmdf"} = " *$";
#-------------------------------------
# IBM VM Batch SMTP mailer
$bounce_from{"ibm-bsmtp"} = "network mailer";
$bounce_subject{"ibm-bsmtp"} = "delivery";
$bounce_startline{"ibm-bsmtp"} = "transaction log follows";
$bounce_endline{"ibm-bsmtp"} = "message follows";
$bounce_left{"ibm-bsmtp"} = "^5[0-9]+.*: *";
$bounce_right{"ibm-bsmtp"} = " *$";
#-------------------------------------
# America On-Line service
$bounce_from{"aol"} = "aol.com";
$bounce_subject{"aol"} = "returned mail";
$bounce_startline{"aol"} = "could not be delivered";
$bounce_endline{"aol"} = "text you sent follows";
$bounce_left{"aol"} = "^.*\\(";
$bounce_right{"aol"} = "\\).*$";
#-------------------------------------
# MCI Mail service
$bounce_from{"mcimail"} = "mcimail.com";
$bounce_subject{"mcimail"} = "rejected";
$bounce_startline{"mcimail"} = "could not be forwarded";
$bounce_endline{"mcimail"} = "your message follows";
$bounce_left{"mcimail"} = "^ *to: *";
$bounce_right{"mcimail"} = " *$";
#-------------------------------------
# CompuServe users
$bounce_from{"compuserve"} = "compuserve.com";
$bounce_subject{"compuserve"} = "undeliverable";
$bounce_startline{"compuserve"} = "\\*\\*\\*\\*\\*";
$bounce_endline{"compuserve"} = "could not process";
$bounce_left{"compuserve"} = "^\\?.*: *";
$bounce_right{"compuserve"} = " *$";
#-------------------------------------
I'd like an easy way to specify this outside of the code, so
bounce profiles can be added without modifying the program
file itself for safety's sake. Any suggestions?
All general comments welcome.
- Alan
---- ,,,,
Alan Millar amillar@bolis.SF-Bay.org __oo \
System Administrator =___/
Batteries not included.
Follow-Ups:
References:
|
|