Mailing List Archive

Running spamassassin on a per user basis
I'm trying to filter mail through spamassassin using procmail called
from sendmail (versions at bottom of message). The problem is that I
only want to do this on a per user basis as opposed to site wide, which
doesn't seem to be common because I have found no documentation relating
to this setup. I have therefore started with the procmail script
distributed with the spamassassin rpm:

# cat /etc/mail/spamassassin/spamassassin-default.rc
# send mail through spamassassin
:0fw
| /usr/bin/spamassassin

Then, I tried calling this rc script from the aliases file using a pipe
to procmail but no combination worked. I then tried copying the rc
script elsewhere and tried all kinds of ownerships and permissions, none
of which worked. So, can someone please tell me:

1. path to rc file with ownership and permissions
2. complete aliases line
3. if using a .forward file, the exact content of the file with
ownership and permissions


# rpm -qa | egrep '(release|spamassassin|procmail|sendmail)'
redhat-release-9-3
sendmail-8.12.8-4
sendmail-cf-8.12.8-4
procmail-3.22-9
spamassassin-2.44-11.8.x

--
Marc Tardif
Sitepak
(514) 866-8883
Re: Running spamassassin on a per user basis [ In reply to ]
Marc Tardif wrote:

> I'm trying to filter mail through spamassassin using procmail called
> from sendmail (versions at bottom of message). The problem is that I
> only want to do this on a per user basis as opposed to site wide, which
> doesn't seem to be common because I have found no documentation relating
> to this setup. I have therefore started with the procmail script
> distributed with the spamassassin rpm:
>
> # cat /etc/mail/spamassassin/spamassassin-default.rc
> # send mail through spamassassin
> :0fw
> | /usr/bin/spamassassin
>
> Then, I tried calling this rc script from the aliases file using a pipe
> to procmail but no combination worked. I then tried copying the rc
> script elsewhere and tried all kinds of ownerships and permissions, none
> of which worked. So, can someone please tell me:
>
> 1. path to rc file with ownership and permissions
> 2. complete aliases line
> 3. if using a .forward file, the exact content of the file with
> ownership and permissions
>
>
> # rpm -qa | egrep '(release|spamassassin|procmail|sendmail)'
> redhat-release-9-3
> sendmail-8.12.8-4
> sendmail-cf-8.12.8-4
> procmail-3.22-9
> spamassassin-2.44-11.8.x
>

Question on your desired config. Do you:

1) Have procmail set up as your local delivery agent for everyone, and
only want to call spamassassin for some users? or
2) Only want to use procmail as your LDA for some users?

If it's the first case, using the example should work. Just be sure to
create a .procmailrc file for each user that wants to call spamassassin.
The file needs to be in their home directory, and named ".procmailrc".
644 permissions work for me, with the user in question owning the file.
If procmail is configured as your LDA, you don't need a forward file.

The following .mc setup will use procmail as LDA (may be your default
config anyhow):

MAILER_DEFINITIONS
MAILER(`local',`F=|')dnl
MAILER(`procmail',`F=u')dnl

You shouldn't need an aliases entry.

If you're looking at only using procmail for certain users, you'll have
to check the procmail docs for calling procmail from a .forward file.
The .procmailrc settings should be the same. I don't think you'll need
any entries in /etc/aliases.

--Rich