procmail
[Top] [All Lists]

Re: Locking problem

1998-05-21 14:24:52
When compiling v3.11pre7 I did these changes:

config.h:
#define NO_fcntl_LOCK     /* uncomment any of these three if you     */
#define NO_lockf_LOCK     /* definitely do not want procmail to make */
#define NO_flock_LOCK     /* use of those kernel-locking methods     */

Makefile:
BASENAME        = /usr/local

src/authenticate.c:
#define MAILSPOOLHOME "/Mailbox"           /* watch the leading/ */
                                           /* delivers to $HOME/.mail */

The reason I did these changes was to make procmail use dot locking and
have it deliver the mail to $HOME/Mailbox instead of /var/mail/user.

Locking strategies:     dotlocking
Default rcfile:         $HOME/.procmailrc
Your system mailbox:    /home/stud/luser1/Mailbox

I am using procmail as a general delivery agent for sendmail. Everything is
working fine when delivering to $HOME/Mailbox. The procmail.log says this:

procmail: Locking "/home/stud/luser1/Mailbox.lock"
procmail: Assigning "LASTFOLDER=/home/stud/luser1/Mailbox"
procmail: Opening "/home/stud/luser1/Mailbox"
procmail: Unlocking "/home/stud/luser1/Mailbox.lock"

But when the user has a .procmailrc file things start going very bad. The
.procmailrc file for luser1 looks like this:

MAILDIR=$HOME/Mail
LOGFILE=$HOME/procmail.log
VERBOSE=ON

:0:joge
* ^From.*joge
joge

This produces the following output in procmail.log:

procmail: Match on "^From.*joge"
procmail: Locking "joge"
procmail: Assigning "LASTFOLDER=joge"
procmail: Opening "joge"
procmail: Error while writing to "joge"
procmail: Unlocking "joge"
procmail: Locking "/home/stud/luser1/Mailbox.lock"
procmail: Assigning "LASTFOLDER=/home/stud/luser1/Mailbox"
procmail: Opening "/home/stud/luser1/Mailbox"
procmail: Unlocking "/home/stud/luser1/Mailbox.lock"

Notice that it does not say

procmail: Locking "joge.lock"
                       ^^^^^
Where does this error come from? Why is it not locking folder.lock instead
of folder?

I forgot to also tell about the problem that arises when the file joge
exists:

procmail: Locking "/home/stud/luser1/Mail/joge"
procmail: [12877] Thu May 21 22:17:31 1998
procmail: Locking "/home/stud/luser1/Mail/joge"
procmail: [12877] Thu May 21 22:17:39 1998
procmail: Locking "/home/stud/luser1/Mail/joge"
procmail: [12877] Thu May 21 22:17:47 1998
procmail: Locking "/home/stud/luser1/Mail/joge"
procmail: [12877] Thu May 21 22:17:55 1998
procmail: Locking "/home/stud/luser1/Mail/joge"
procmail: [12877] Thu May 21 22:18:03 1998
procmail: Locking "/home/stud/luser1/Mail/joge"
procmail: [12877] Thu May 21 22:18:11 1998
and so on in infinity...

This is even worse an error than the other one.


Another issue I would like to have some info on is this:

All regular users have the shell /bin/not_privileged on the mailserver
because we do not want anyone to log into the machine and work
interactively. It is not for security, merely to reduce load.

When someone has something like this in .procmailrc

MAKEDIRDUMMY=`test -d $MAILDIR || mkdir $MAILDIR`

procmail fails because it tries to execute

/bin/not_privileged test -d $MAILDIR || mkdir $MAILDIR

How can we make it execute with e.g. /bin/bash instead no matter what the
shell is in /etc/passwd?

--
Geir Johannessen          #  joge(_at_)stud(_dot_)ntnu(_dot_)no
E B Schieldropsvei 35-25  #  http://www.stud.ntnu.no/~joge/
N-7033 TRONDHEIM, NORWAY  #  Tlf private +47-73888989, job +47-73598048
"*THE* ultimate computer virus:  MSDOS - even with updates!"


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