On Wednesday 19 Feb 2003 15:34, Derek Jennings wrote:
> On Wednesday 19 Feb 2003 2:38 pm, Peter Watson wrote:
> > My local mail gets put in /var/spool/mail/username. However I would
> > like to read it in Kmail and so I have set up an incoming account
> > which reads from /var/spool/mail/username, this is ok except that when
> > I try to get mail I receive a message "could not lock
> > /var/spool/mail/username".
> >
> > If I change the permissioms on /var/spool/mail/ to let others write
> > entries everything works fine for a while until something (?msec)
> > changes the permissions back to what they were.
> >
> > Can anyone tell me an elegant solution to this problem please?
>
> If you were to read your mail spool at the same time as postfix was
> writing to it, nasty things can happen. So to avoid this a lockfile is
> created before Postfix starts writing, and will be deleted again when it
> is finished. Kmail will not try to read the spool if the lockfile is
> present. Similarly Kmail will create the lockfile before reading.
> The default lockfile is /var/spool/mail/user_name.lock which your user
> does not have write permission to hence your problem.
>
> To fix it you could either configure your Kmail to not bother with the
> lockfile (in the account settings), or else you could use procmail to
> define a different lockfile.
>
> If a ~/.procmailrc file exists postfix will pass mails over to procmail
> for final delivery. An example ~/.procmailrc looks like this:-
>
> SHELL=/bin/sh
> PATH="$HOME/bin:/usr/bin:/usr/local/bin:/usr/include:/usr/local/sbin:/bi
>n:/sbin:/usr/sbin" MAILDIR=$HOME/Mail
> LOCKFILE=/home/derek/.procmail/lockfile.lock
> DEFAULT=/home/derek/Maildir
> JUNKMAIL=/home/derek/junkmail
> LOCKTIMEOUT=10
> LOGFILE=~/procmail.log
> LOGABSTRACT=all
> VERBOSE=no
>
>
> #Run SpamAssasin
>
> :0fw
> :
> | spamassassin -a -P
> |
> :0e
>
> {
>    EXITCODE=$?
> }
>
> :0: $LOCKFILE
>
> * ^Subject:.*\*\*\*\*SPAM\*\*\*\*
> $JUNKMAIL
>
>
> # Catches everything else.
>
> :0 : $LOCKFILE
>
> $DEFAULT
>
> In this configuration mails end up in ~/Maildir, and the lockfile is
> ~/lockfile.lock.  This procmailrc also runs spamassassin to mark suspect
> emails and put them into a mailfolder called JUNKMAIL
>
> See man procmailrc
>
> HTH
>
> derek
Derek
Thanks for the reply (and Tod and Greg). I created a ~/.procmailrc file 
similar to yours but 
without spamassassin and am now using the procmail lockfile I defined in 
my home directory, so this has solved my problem.

However I am intrigued by how procmail works, in order to get mail 
transferred into the default folder I defined I need the last two lines 
you quote ie:-
:0:$LOCKFILE
$DEFAULT

But none of the examples in man procmail seem to include this and the 
comments imply that everything left at the end goes to $DEFAULT by er! 
default.
Am I missing something?
-- 
Regards

Pete
Ardnamurchan    Scotland

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to