On Tue, May 12, 1998 at 01:07:21AM +0000, Peter J. Schoenster wrote:
> On 11 May 98 at 19:49, Jack Killpatrick wrote:
> 
> > I would like to have a way to check the emails that have been sent
> > via sendmail against the ones in the database so I can spot any
> > errors that may have occurred in the sendmail process. For example,
> > let's say sendmail fails for some reason (some loose and crazy
> > process that stymies the system so that sendmail is rendered
> > useless, while perl and msql continue to function). I'd like to
> > compare a record of sent mail to the records in the database, using
> > the index as a key. Then I could spot any submissions that were not
> > sent out by sendmail.
> 
> Umm.. not sure if I really understand but that hasn't stopped me 
> before.
> 
> When you open sendmail do you not do this:
> 
> open sendmail || do something else

You're correct, and you're not correct.

What you propose will tell you if sendmail returns a non-zero exit
code immediately, but that isn't what you really need to know: you
need to know if the mail actually got delivered.  And there's no
way to know that at the time you submit mail to sendmail's queue,
because sendmail itself doesn't know if the mail's deliverable (except
in truly pathological cases, e.g. malformed addresses).

In other words, just because sendmail accepts a message for delivery
on your local host doesn't mean that it will be successful.  There can
be transient failures (DNS timeouts, loss of connectivity to the
remote host), permanent failures (unknown host, unknown user) and about
a zillion other things that can go wrong.

My solution would be to use the -f flag to set the return adddress, e.g.

"|/usr/lib/sendmail -oi [EMAIL PROTECTED] someuser@somewhere"

as well as burying the true recipient in an X-header, e.g.

X-Really-Really-To: someuser@somewhere

and then have mail coming back to "bounces" piped into a perl script
that extracts the X-Really-Really-To field and marks it as "not 
delivered" in your database or wherever it needs to be noted.

---Rsk
Rich Kulawiec
[EMAIL PROTECTED]
____________________________________________________________________
--------------------------------------------------------------------
 Join The Web Consultants Association :  Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------

Reply via email to