No such thing as a small change | |
PerlMonks |
Re: SendMail works 99% of the timeby hagus (Monk) |
on May 19, 2002 at 11:38 UTC ( [id://167639]=note: print w/replies, xml ) | Need Help?? |
It is a little unclear what you are after here. Where are you calling sendmail from? I assume from a CGI program hosted somewhere. If so, it depends on the type of error you're getting. If delivery failed because sendmail returned an error code, you can obviously test for that. If delivery is failing and being reported back with a bounce, that won't be recorded in the sendmail logs, AFAIK. What will happen is that a bounce will be generated and e-mailed to the originator of your message (using the reply-to address I guess). So ... you could do something like have procmail running somewhere in some special user account, invoking a script that you've written which parses bounce e-mails. Make sure the user running procmail is set as the reply-to of outgoing e-mails. Attach an X-header so you can match up replies with transmission attempts. And Bob's your father's brother. Seems like the best way to me - because if your hosting service's sendmail can't transmit the message, *it* will return a bounce. But what if the remote mailbox is full? Then the destination SMTP server will generate the bounce, and your hosting service's sendmail will calmly deliver that without a second glace. Sendmail doesn't parse incoming e-mails to determine whether they are bounces for something it has transmitted in the past. So your hosting providers logs of bounces (if they exist) won't contain the whole story. Just thinking off the top of my skull, HTH - HAND.
--
In Section
Seekers of Perl Wisdom
|
|