* <[EMAIL PROTECTED]> [13/07/2005 1657EDT]:
> On Wed, Jul 13, 2005 at 12:08:29PM -0400, Keith Warno wrote:
[...]
> > Is there some program I can use via a .qmail program line that, when a
> > mail comes in for a user, it'll establish an SMTP connection to the
> > exchange box?  Oh wait.... how about calling qmail-remote directly?
> > Does it make sense to do
> > 
> >     |qmail-remote exchange.server.whatever "$SENDER" "$RECIPIENT"
> > 
> > ?
> 
> May work but it be prepared for strange results if the exchange is down.
> I don't know if qmail-remote uses the well known exit codes (100, 111) or
> if it does use some others. So if you like to do it like this test it
> carefully because mails may get dropped because they are not queued
> (actually they are still in the queue but if you exit 0/100 the mail will
> be removed from the queue).
> So have a look at the exit codes of qmail-remote.

According to the man page:

       qmail-remote prints some number of recipient  reports,  followed
       by  a message  report.   Each  report is terminated by a 0 byte.
       Each report begins with a single letter:

       r    Recipient report: acceptance.

       h    Recipient report: permanent rejection.

       s    Recipient report: temporary rejection.

       K    Message report: success.  host has taken responsibility for deliv-
            ering the message to each acceptable recipient.

       Z    Message report: temporary failure.

       D    Message report: permanent failure.

       After  this letter comes a human-readable description of what happened.

and:

       qmail-remote always exits zero.

So, the exit code is useless in a .qmail file.  However, wrapping
qmail-remote in a shell script that checks the recipient report and
message report and exits appropriately is not useless.  This is in fact
what I've done and it seems to work so far.

Keith
-- 
SA Valaran Corp
GPG: 0xEC705AE9
I put the sh in IT.

Attachment: pgp6ZEMulHcAj.pgp
Description: PGP signature

Reply via email to