procmail
[Top] [All Lists]

Re: [Q] Exit value

2000-04-07 12:54:00
sam(_at_)Progressive-Systems(_dot_)Com writes:
[~]$ procmail -f- /tmp/nofile < /dev/null
procmail: Couldn't read "/tmp/nofile"
[~]$ echo $?
0

Will someone please explain to me why procmail exits with a true value
when the specified rcfile doesn't exist?  It's clear procmail did not
process the input, so I'm not sure why procmail is returning success.

Procmail's exit status reflects its ability to deliver the message.  If
it runs out of rcfile(s) to process, it simply tries to deliver the
message to $DEFAULT.  When not in mailfilter mode, the DEFAULT variable
will be set to the compiled in mailspool location.  So, the above
procmail usage resulted in an empty message being delivered to
$DEFAULT (actually, it would have included a "From " line, and nothing
else).

So yes, procmail _did_ process the mail message, and it delivered it
successfully at that.  If you want a missing rcfile to result in an
error return, use mailfilter mode ("-m").


Philip Guenther

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