procmail
[Top] [All Lists]

Re: detecting failure to chdir() to $MAILDIR

1997-05-15 01:31:00
On Wed, 14 May 1997 11:17:51 -0400,
Roderick Schertler <roderick(_at_)argon(_dot_)org> wrote:
    MAILDIR = /oldbox/roderick/inbox
    :0
    * ? test x-"`pwd`" != x-"$MAILDIR"
    { EXITCODE = $EX_TEMPFAIL HOST }

Well, you can test for the mere existence of the directory and see if
you have execute permission on it. It should mean the same thing, and
save you a process (and IMHO make the recipe a bit more readable). 

    MAILDIR=/oldbox/roderick/inbox
    :0
    * ? test -d "$MAILDIR" -a -x "$MAILDIR"
    { EXITCODE=$EX_TEMPFAIL HOST }

(If your test binary is so broken that it wants that leading x- stuff,
it might also not have the -a switch, in which case you'll end up
needing two tests anyway. But this shouldn't break on symlinks.)

Hope this helps,

/* era */

I wouldn't have thought you were permitted to have spaces around the
equals signs but it turned out just to be paranoia on my part. :-)

-- 
Defin-i-t-e-ly. Sep-a-r-a-te. Gram-m-a-r.  <http://www.iki.fi/~era/>
 * Enjoy receiving spam? Register at <http://www.iki.fi/~era/spam.html>

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