procmail
[Top] [All Lists]

Re: Q: using your own delivery program

1999-05-20 08:35:52
era eriksson <era(_at_)iki(_dot_)fi> writes:
On Thu, 20 May 1999 13:01:15 +0200 (MET DST), "Gjermund S\xF8rseth"
<gjermund(_at_)nextel(_dot_)no> wrote:
    :0
    | /bin/deliver-mail
But sometimes delivery might not succeed, so you want procmail to exit
with the same exit code as "deliver-mail" does, so that the MTA can

If you fall through, propagate the exit code back to the caller.

   :0
   | /bin/deliver-mail

Correction: there should be a 'w' flag on that.

   # Exitcode from deliver-mail will be non-0 if we fall through to here
   #  (and it's reporting exit codes correctly)

   EXITCODE=$?

If you want the message to be requeued instead of saved to DEFAULT,
you should probably also exit immediately (e.g. by setting HOST).

So:
        :0 w
        | /bin/deliver-mail
        # Set exit code and exit
        EXITCODE=$?
        HOST


Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>