On Sat, 18 May 2002, Marc G. Fournier wrote:
> On Sat, 18 May 2002, Daniel Pittman wrote:
>> On Fri, 17 May 2002, Marc G. Fournier wrote:

[...]

>> The simple filtering mode of Postfix, using a shell script and piped
>> data, can have the SMTP envelope information passed on the command
>> line. I use that.
> 
> can you post your config/scripts?

Sure. In master.cf I have:

spam      unix  -       n       n       -       -       pipe
  flags=Rq user=mailfilter argv=/home/mailfilter/spam-filter ${user} -f ${sender} -- 
${recipient}

smtp      inet  n       -       -       -       -       smtpd
  -o content_filter=spam:

The second defines the mail filter script, run as an unprivileged user
just in case someone manages to sneak something noxious into an email
address or the like.

The spam-filter script is:

---------- cut here ----------
#!/bin/busybox sh
#
# Process mail through SpamAssassin, adding the results, then feed it back into
# the PostFix process.
user="$1"
shift

exec spamc -u "${user}" | /usr/sbin/sendmail -i $@
---------- cut here ----------

This is pretty trivial, obviously, but gets the user thing right by
passing it to the daemon correctly. It depends on home directories
containing the right stuff. :)

I found that using a statically linked busybox shell made a *huge*
difference to the performance when processing high mail loads with the
tools.

        Daniel

-- 
When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing to fear from them, then he is always stirring up some war or
other, in order that he people may require a leader.
        -- Plato

_______________________________________________________________
Hundreds of nodes, one monster rendering program.
Now that's a super model! Visit http://clustering.foundries.sf.net/

_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to