procmail
[Top] [All Lists]

Re: MAILDIR as test -d

2004-03-15 14:44:43
Toen ik Professional Software Engineering kietelde, kwam er dit uit:
Ruud H.G. van Tol:

The initial value of MAILDIR is $HOME.
See man procmailrc for the Unless.

If you set MAILDIR to a non-existing directory name,
the value of MAILDIR becomes dot.

Food for thought (an examination of the source should lead to an
answer): 

What happens if you set it to a directory which at the time you SET it,
exists, but during the course of the rcfile processing, is deleted -
either by something invoked from procmail, or independantly.

Hehe, always do a MAILDIR=$MAILDIR before you use it.


NL = "
"

VERBOSE=on

MAILDIR = $HOME/rc/test12
:0
* MAILDIR ?? \.
{ dummy = `mkdir $HOME/rc/test12` }

MAILDIR = $HOME/rc/test12
LOG = "($MAILDIR)$NL"

:0c:
test-1

dummy = `rm -fr $HOME/rc/test12`

:0c:
test-2

MAILDIR = $MAILDIR
LOG = "($MAILDIR)$NL"

:0c:
test-3

:0
/dev/null


Running the above rc gives the folowing log:

procmail: [98441] Mon Mar 15 22:33:01 2004
procmail: Assigning "MAILDIR=/home/r/rvtol/rc/test12"
procmail: Couldn't chdir to "/home/r/rvtol/rc/test12"
procmail: Assigning "MAILDIR=."
procmail: Match on "\."
procmail: Executing "mkdir,/home/r/rvtol/rc/test12"
procmail: Assigning "dummy="
procmail: Assigning "MAILDIR=/home/r/rvtol/rc/test12"
procmail: Assigning "LOG=(/home/r/rvtol/rc/test12)
"
(/home/r/rvtol/rc/test12)
procmail: Locking "test-1.lock"
procmail: Assigning "LASTFOLDER=test-1"
procmail: Opening "test-1"
procmail: Acquiring kernel-lock
procmail: Unlocking "test-1.lock"
procmail: Executing "rm,-fr,/home/r/rvtol/rc/test12"
procmail: Assigning "dummy="
procmail: Locking "test-2.lock"
procmail: Error while writing to "1079386381.98441.001.xs2.xs4all.nl"
procmail: Lock failure on "test-2.lock"
procmail: Assigning "LASTFOLDER=test-2"
procmail: Opening "test-2"
procmail: Error while writing to "test-2"
procmail: Assigning "MAILDIR=/home/r/rvtol/rc/test12"
Segmentation fault (core dumped)

Oops.

-- 
Affijn, Ruud

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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