Dear Gary
Thank you again for your kind response.
My guess is that your script is sometimes not being run as 'root',
or is always run on a per-user basis.
Procmail is integrated in sendmail's .cf file using
FEATURE(`local_procmail', `/usr/local/procmail/bin/procmail')
.forward file is not used. This happens for users that do not have
~/.procmailrc or ~/.forward files.
No I noticed inetersting fact, that this happens only when user is sending
mail to user on local machine. No problems if mail is from outside. Users
are using pine to send mail and pine always is using sendmail to deliver
emails.
I assumed, that actually there is no difference if script is run by root or
any other user. Temporary directory should be always created in /tmp with
rights of user that is running script ?
You don't have the assignment to TRAP, which
will ensure that the temp. directory is later removed:
TRAP="rm -rf $TMPDIR; $TRAP"
I posted not full code. I have one line after that, so I am sure, that
TMPDIR is removed (I also checked this before posting a mail). Here is code
again with missing line :
MUNPACK=/usr/local/procmail/bin/munpack
TMPDIR=/tmp/procmail.$$
:0 Wic
| mkdir -p $TMPDIR
FLIST = `$MUNPACK -q -t -C $TMPDIR 2>/dev/null`
:0 Wic
| rm -rf $TMPDIR
Now sometimes (not every time!) I am getting this message :
procmail: Assigning "MUNPACK=/usr/local/procmail/bin/munpack"
procmail: Assigning "TMPDIR=/tmp/procmail.36688"
procmail: Executing "mkdir,-p,/tmp/procmail.36688"
procmail: [36688] Thu Mar 18 09:16:41 2004
procmail: Assigning "LASTFOLDER=mkdir -p /tmp/procmail.36688"
procmail: Executing "cd $TMPDIR; $MUNPACK -q -t -C $TMPDIR 2>/dev/null"
I didn't see this "cd $TMPDIR;" in the procmailrc file that you
gave above. Is the log output shown in sync. with the procmail
recipe that you listed?
Sorry about this. I just tried to change line to this :
FLIST = `cd $TMPDIR;$MUNPACK -q -t -C $TMPDIR 2>/dev/null`
But this try ended with same result and I sent ecerpt from that log.
See above. (1) because the procmail script isn't always being run as
super-user, and (2) the temporary directories aren't being removed after
they're used.
In my opinion it should make no differnce if script is run by root or not
root as it is creating $TMPDIR in /tmp in same procces. Next line is
executing munpack with same user rights. Temporary directory is removed
without error. Here is excerpt again with some additional lines where you
can see, that directory was removed succefully :
procmail: Assigning "MUNPACK=/usr/local/procmail/bin/munpack"
procmail: Assigning "TMPDIR=/tmp/procmail.24652"
procmail: Executing "mkdir,-p,/tmp/procmail.24652"
procmail: Assigning "LASTFOLDER=mkdir -p /tmp/procmail.24652"
procmail: Executing "$MUNPACK -q -t -C $TMPDIR 2>/dev/null"
shell-init: could not get current directory: getcwd: cannot access parent
directories: Permission denied
cd_links: could not get current directory: getcwd: cannot access parent
directories: Permission denied
/usr/local/bin/bash: cd: /tmp/procmail.24652: Permission denied
job-working-directory: could not get current directory: getcwd: cannot
access parent directories: Permission denied
procmail: Assigning "FLIST="
procmail: Executing "rm,-rf,/tmp/procmail.24652"
procmail: Assigning "LASTFOLDER=rm -rf /tmp/procmail.24652"
So it happens in one procces : user create dir, user can't access dir
created just one line before, user can delete dir. Any ideas ?...
With best regards
Martynas
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail