B3r3n wrote:
> Hi Jari,
>
> Thanks for your answer.
>
>
> Jari Fredriksson wrote:
>   
>> Not much help from this, but I wonder how this goes... Normally, standard
>> Amavis does not call spamd at all, but loads it's own copy of spamassassin
>> - as they both run under perl, and amavis is a resident process. No need
>> for spamc/spamd for Amavis.
>>
>> I do run spamd/spamc pair, and have disabled spamassassin in my
>> amavisd-new configuration. I call spamc via maildrop script.
>>     
>
> Realizing definitely I made a mistake. Amavisd does not call SpamAssassin.
>   

so what does it do in your setup?

> Postfix does.
> master.cf says:
> smtp      inet  n       -       n       -       -       smtpd-laurent     

what is smtpd-laurent? symlink hacks aren't recommended. if you want
different logs, use multiple instances.

>    
> -o content_filter=spamassassin
> submission inet n      -       n       -       -       smtpd-laurent       
> -o content_filter=spamassassin
> spamassassin    unix    -       n       n       -       5       pipe   
> user=spamd argv=/etc/mail/bin/spamass-filter ${sender} ${recipient}
>
>   

This is fragile as documented in postfix FILTER README. amavisd-new is
the right method if you don't want per recipient bayes. if you want pe
recipient bayes, then run spamc at delivery time (procmail, maildrop, ...).

Note that the above sets the content filter for mail received via smtp,
not via the (compatibility) sendmail command.


> spamass-filter says:
> | #!/bin/ksh
>   

are you starting a counter strike against (silly) /bin/bash
practictioners? The most important thing in the shell is its
portability. if you can't use /bin/sh, then try perl, python, php, ruby,
java, ... etc.

> | #
> | INSPECT_DIR=/var/spool/spamd
> | SENDMAIL="/usr/sbin/sendmail -oi"
> | SPAMASSASSIN="/usr/local/bin/spamc -d jail-ip -p 783"
> | 
> | ORIGIN=$1
> | TARGET=$2
> | 
> | # Exit codes from <sysexits.h>
> | EX_TEMPFAIL=75
> | EX_UNAVAILABLE=69
> | 
> | cd $INSPECT_DIR || { echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL;
> }
> | 
> | # Clean up when done or when aborting.
> | trap "rm -f in.$$; rm -f out.$$" 0 1 2 3 15
> | 
> | # Filter for Spam
> | cat | $SPAMASSASSIN > out.$$
> | 
> | cat out.$$ | /usr/sbin/sendmail -io -f $ORIGIN $TARGET
>   

I too love cats. but "$cmd < $file" does the same as "cat $file | $cmd".

by the way, what if ORIGIN or TARGET contain spaces or other characters?
always quote (shell) arguments.
> | 
> | cp out.$$ /tmp/toto.$$
> | 
> | exit $?
>
> To notice I really have a copy into /tmp/toto.pid for each mail, confirming
> script is really called.
>
> I also tested using spamc directly from shell: cat sample-spam.txt |
> /usr/local/bin/spamc -d jail-ip -p 783.
>
> Another mistake from me in my answer to Michael. The spamc output confirms
> spam-assassing checked (badly) the message. It added a single header line:
> X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on mx.mydomain
>
> Brgrds
>   

Reply via email to