On Sat, 6 Apr 2002, [x-user-defined] toylet.linux[¤pª±·N] wrote:

> when I use /etc/procmailrc to start procmail, 
> what user does it assume? root or ... whatever?
> seems that it's not root...
> 
> I know the case when it was started in /home/user

Well, I don't pretend to be a procmail guru by any means and I highly 
recommend you read the man files.  There are lots of examples available on 
the web too.

That said...When a user receives mail and procmail is enabled a procmail
process is kicked off for each message.  First, procmail searches for a
.procmailrc file in the user's home directory.  If that isn't found then
procmail looks for /etc/procmailrc.  

There are situations when this can result in running procmail as root if
it isn't set correctly so be careful.  Also, if several messages arrive at
the same time there may be contention in storing the messages.  That's
were the lock files come in.  They prevent various procmail processes from
stomping all over each other.

I only have a few users on my home network and have individual .procmailrc
files in each of their directories customized by user.  I use procmail to
screen out obvious spam for the most part although I do have some messages
automatically forwarded to different users.  I don't use the
/etc/procmailrc file at all.

One nice recipe is to eliminate duplicate messages (when those idiots go
on holidays and leave vacation messages pouring into list servers!!!).  I
see that you're using that recipe too.  If you want to use individual
.procmailrc files then change entries like /var/log/msgid.cache to the
user's home directory ie /home/gerry/msgid.cache to get around permission 
problems.

Here's some sample lines from my .procmailrc file:


SHELL=/bin/sh
ABYSS=/dev/null
LOGFILE=/var/log/procmail
VERBOSE=off
SENDMAIL=/usr/sbin/sendmail
MAILDIR=/var/spool/mail
DEFAULT=/var/spool/mail/gerry
HOME=/home/gerry

:0 Wh: $HOME/msgid.lock
| formail -D 8192 $HOME/msgid.cache

:0:
* ^From: .*(bellzinc\
|casino\
|musicmatch\
)
$ABYSS

:0 c
* ^(From: |To:|Cc:) .*aircanada 
! [EMAIL PROTECTED]

:0:
* ^Content-Type: .*(ks.*\
|ISO-2022-JP\
|ISO-8859-9\
)
$ABYSS

:0 D
* ^date:
$ABYSS

:0:
* ^X-Advertisement:.*
$ABYSS

:0:
* To: [ ]*$
$ABYSS

:0:
* To: .*(Undisclosed|undisclosed)
$ABYSS

:0:
* !To: .*
$ABYSS

:0fw:$HOME/spam.lock
| spamassassin -P
:0e
{
 EXITCODE=$?
  }
:0:  
* ^Subject:.*\*\*\*\*SPAM\*\*\*\*
$ABYSS

:0:
* ^(From: |To:|Cc:) .*(redhat\
|suse\
|linux\
|caldera\
|lvm\
|monmotha\
|pan\
|JISCMAIL\
|samba\
|gamespy\
|licq\
)
$DEFAULT


I have some other stuff after this but I don't want to totally bore you!!!  
I should clean the .procmailrc files up some day since stuff gets added in 
a rather ad hoc way.

Gerry


_______________________________________________
Linux-users mailing list - http://linux-sxs.org/mailman/listinfo/linux-users
Subscribe/Unsubscribe info, Archives,and Digests are located at the above URL.

Reply via email to