Not meaning to answer for Troy, but I don't think anything is "Wrong" with
this, but it doesn't do what Troy is doing...

He's using localmailfilter as a recpt filter on mail acceptance - he runs
spamassassin on acceptance (i.e. before delivery) and rejects the mail if it
scores over "X" - so he doesn't get a queue full of bounces to bad addresses
with "your message was detected as spam" messages... BUT his problem I think
was that he had to run spamassassin twice - once on recpt and once in
delivery mode.

My problem was how to take his localfilter idea and apply it to mail in a
global location as I use DB storage of user preferences .... I think I'll do
that by hacking gordon messmers filter to call spamc - just my current
idea - not tried it yet.

Thanks for the tip on ash.

that seems to make a big difference.

m/

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Mirko
Zeibig
Sent: Wednesday, November 26, 2003 4:55 AM
To: [EMAIL PROTECTED]
Subject: Re: [courier-users] Spamassasin, maildropfilter, and
courier-mta integration


[Troy and Mitch were discussing usage of maildroprcs and .mailfilter with
includes
maildroprcs ...]

Pardon me, what's wrong using just a /etc/courier/maildroprc like this:
--- snip ---
[EMAIL PROTECTED] mirko]$ cat /etc/courier/maildroprc
import SENDER
import RECIPIENT
import HOME
import USER
PATH=/bin:/usr/bin:/usr/local/bin:/usr/lib/courier/bin/
INBOX="Maildir/"
DEFAULT="$INBOX"
SPAMFLD="$INBOX.Trash/"
SHELL=/bin/ash

xfilter "reformail -A 'X-Maildrop-HOME: $HOME' -A 'X-Maildrop-SENDER:
$SENDER'
-A 'X-Maildrop-RECIPIENT: $RECIPIENT' -A 'X-Maildrop-USER: $USER'"

# create some needed directories
`test -d "$SPAMFLD"`
if( $RETURNCODE == 1 )
{
      `maildirmake "$SPAMFLD"`
}

# filter message
if ( $SIZE < 512000 )
{
        xfilter "/usr/bin/spamc -U /var/run/spamassassin.sock -u $USER"
}

if ( /^X-Spam-Status: Yes,/ )
{
      DEFAULT="$SPAMFLD"
}
--- snap ---

The trick is to supply a value for SHELL, otherwise this snippet will not
work.
I use ash because it is much smaller than bash and starts much faster:

--- snip ---
[EMAIL PROTECTED] mirko]$ ash
$ ps u
USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
mirko    26397  2.4  0.7  4896 1940 pts/6    S    13:45   0:00 /bin/bash
mirko    26443  0.0  0.1  1448  436 pts/6    S    13:45   0:00 ash
mirko    26444  0.0  0.2  2632  688 pts/6    R    13:45   0:00 ps u
[EMAIL PROTECTED] mirko]$ time bash ls
ls: /bin/ls: cannot execute binary file

real    0m0.044s
user    0m0.010s
sys     0m0.030s
[EMAIL PROTECTED] mirko]$ time ash ls
ash: Can't open ls

real    0m0.005s
user    0m0.000s
sys     0m0.000s
[EMAIL PROTECTED] mirko]$
--- snap ---

For interactive usage I wouldn't recommand ash, as it does not offer bash's
whistles and bells (no completions, no history, no startup files), but for
simple scripts running often it's just perfect.

I am running spamd with the following options:

[EMAIL PROTECTED] mirko]$ cat /etc/sysconfig/spamassassin
# Options to spamd
SPAMDOPTIONS="-d -c -a -x -u
vmail --virtual-config-dir=/home/vmail/domains/%d/%l --socketpath=/var/run/s
pamassassin.sock"

as I do not deliver mail locally, using userdb to administer my virtual
domains.

You need spamassassin >= 2.6 to use the virtual-config-dir option like
above.

Regards
Mirko


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to