On Mon, Jan 05, 2004 at 12:26:18PM +0100, Eric Persson wrote:
Hi,
I'm still poking around with the maildrop implementation I asked about
earlier. It works as it is now, but I like to extend the whole setup
with more features. :)
What I'm wondering, is the exitcodes that maildrop returns. Are they
different depending on how the filtering goes. For example, is the
return code different if the mail is delivered by to or not?
I didnt find anything about this in the man pages, any hints or directions?
$ man maildropfilter
[SNIP]
OTHER SPECIAL VARIABLES
The following variables are automatically used by maildrop
when the filter file is being processed:
EXITCODE
Return code for maildrop. When maildrop successfully
delivers a message, it terminates with this exit code,
which defaults to 0. When the to or the cc command is
used to deliver the message to an external process, via
a pipe, maildrop will set this variable to the exit
code of the external process. Since maildrop immedi-
ately terminates after completing the to command this
means that maildrop's exit code will be the exit code
of the external process. If the to command does not
deliver the message to a process you must set EXITCODE
before the to command, since maildrop terminates
immediately after finishing the delivery.
[SNIP]
A quick perusal of the source shows that delivery failure will throw
appropriate EXITCODEs, such as EX_NOUSER and EX_NOPERM when appropriate.