procmail
[Top] [All Lists]

Re: Using procmail with SendMail for all users

1997-09-24 09:57:30
From: Mark Parr <markp(_at_)e9(_dot_)com>
Subject: Using procmail with SendMail for all users
Date: Tue, 23 Sep 1997 21:48:26 -0500

I'd like to use ProcMail with SendMail to filter out all undesirable =
senders (ie spams) for everyone at my site -- not just individuals.  =
Therefore, I don't want every user having to configure ProcMail for the =
spammers -- I would rather do it system wide.  From I want I can read =
this is doable -- however, either I just can't figure out what I'm doing =
wrong with the setup or something.

Any words of advice (via private email or the list) would be =
appreciated.  Also, anyone who has already done this that can send your =
configuration files as a sample, that too would be appreciated.

The following is based mainly on the files INSTALL and examples/advanced
from the procmail-3.11pre7 distribution.

At my site, I built and installed procmail suid (make install-suid)
without changing Makefile or config.h.  Then I replaced /bin/mail with
procmail in my sendmail.cf with the following edits.  Note that these
particular edits were necessary to support sendmail 4.1/SunOS 4; they
are different for V8 sendmail.

Make "+" special to allow parsing out meta-arguments.

  < Do.:%(_at_)!^=/[]
  > Do.:%(_at_)!^=/[]+

Replace mail with procmail.  Now all mail is delivered by procmail.

  < Mlocal, P=/bin/mail,        F=rlsDFMmnP, S=10, R=20, M=3145728, A=mail -d $u
  > Mlocal, P=/usr/bin/procmail, F=sSDFMhPfn, S=10, R=20, M=3145728, A=procmail 
-Y -a $h -d $u

In all places where the local mailer is used, provide the meta-argument,
either empty or parsed out of the mailbox as given by the sender.

  < R@                    $#local $:$n                    null address (mailer 
daemon)
  > R@                    $#local $@ $:$n                 null address (mailer 
daemon)

  < R$+                   $#local $:$1                    local names
  > R$++$*                $#local $(_at_)$2 $:$1               local argument
  > R$+                   $#local $@ $:$1                 local names

Once procmail is doing local delivery, you can put global filters in
the file /etc/procmailrc.  It and its directory ancestors should be
owned by root and writable by nobody else but owner, and it should be
written as if it runs as root, not as the recipient -- because it does,
of course.

This installation method obviates the need to call procmail from the
.forward file.

Comments or suggestions from anyone welcome.

Regards, Ed
-- 
I feel careful thought, imagination, a waterbed, waterballoon and other
assorted 'rubbery surfaces' can go a long way to getting a person started.  --
Jerry Langland (on visualizing General Relativity)

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