I tried to install and adapt your script but it seems that it does not
send the correct message to spamd.
Where can i find logs left from my plugin that i can see if i run

spamassassin message -D ?

what's the difference between spamassassin command and spamd?



2010/12/2 Neil Lazarow <nlaza...@naknan.com>:
> Massimiliano Giovine wrote:
>>
>> YESSSS! Thanks!
>> I'd like also this solution... Can you give me more details?
>> how to install it, e.g.
>>
>>
>>
>> 2010/12/2 Neil Lazarow <nlaza...@naknan.com>:
>>
>>>
>>> Massimiliano Giovine wrote:
>>>
>>>>
>>>> No chance to reproduce this beavior with postfix?
>>>>
>>>> 2010/12/2 Florian Thiessenhusen <florian.thiessenhu...@admeritia.de>:
>>>>
>>>>
>>>>>
>>>>> Hey Massimiliano,
>>>>> you should use Amavisd-New (with Build-In Spamassassin and possibility
>>>>> to
>>>>> discard Spam) or Procmail as MTA. With Procmail you can built your own
>>>>> rules. The main Problem with procmail is the bad performance. I
>>>>> recommend
>>>>> amavisd-new.
>>>>>
>>>>> Florian
>>>>>
>>>>>
>>>>> -----Ursprüngliche Nachricht-----
>>>>> Von: Massimiliano Giovine [mailto:evocthur...@gmail.com]
>>>>> Gesendet: Donnerstag, 2. Dezember 2010 08:35
>>>>> An: Spamassassin
>>>>> Betreff: Discard spam messages
>>>>>
>>>>> Hi all.
>>>>>
>>>>> i'm writing here because i'd like to have a certain behavior from
>>>>> spamd.
>>>>>
>>>>> I wrote a plugin that assign 10 pt to a mail message:
>>>>> when i manually run spamassassin it says "hey that's spam".
>>>>> How can i tell to spamd to automatically discard this item?
>>>>> For "automatically discard" i mean, "do not deliver it to user
>>>>> mailbox".
>>>>>
>>>>> What do i have to do?
>>>>>
>>>>> Thanks in advance.
>>>>>
>>>>> Massimiliano
>>>>>
>>>>>
>>>>>
>>>
>>> I use a script that redirects messages detected as spam to a central user
>>> account "spamtrap" before they get
>>> delivered to end users.
>>> -- Neil
>>>
>>> --
>>>
>>> Neil Lazarow - IT Sales / Systems Engineering
>>> Naknan, Inc.  IT Solutions
>>> SDB, HMBC Member
>>> Minority, Woman-Owned TX HUB
>>> Cisco Authorized Reseller
>>> NEC Authorized Reseller
>>> Phone: 281-990-0030 ext 22
>>> Fax: 281-990-0033
>>> nlaza...@naknan.com
>>>
>
> You mentioned that you are using postfix, which I am doing as well.
> You should already have a line similar to this in your master.cf:
>
> smtp      inet  n       -       n       -       -       smtpd
>  -o content_filter=spamassassin
>
> and the following line is an adjustment to the call of the spamc process:
>
> spamassassin     unix    -       n       n       -       100     pipe
>  flags=Rq user=spamtrap argv=/usr/bin/spam-filter.sh -f ${sender} --
> ${recipient}
>
>
> Here is the spam-filter.sh script that I am using:
> ------------------------------
>
> #!/bin/bash
> # spam-filter.sh
> #
> # This script redirects mail flagged as spam to a separate account
> # You must first create a user account named "spamtrap" to hold the flagged
> mail
>
> SENDMAIL="/usr/lib/sendmail -i"    # adjust this to the path of your postfix
> sendmail binary
> SPAMASSASSIN=/usr/perl5/bin/spamc  # adjust this to the path of your spamc
> binary
> COMMAND="$SENDMAIL $@"
> USER=`echo $COMMAND | awk '{ print $NF }' | sed 's/@.*$//'`
> NEW_COMMAND=`echo $COMMAND | awk '{ $6 = "spamtrap"; NF = 6; print }'`
>
> # Exit codes from <sysexits.h>
> EX_TEMPFAIL=75
> EX_UNAVAILABLE=69
>
> umask 077
>
> OUTPUT="`mktemp /tmp/mailfilter.XXXXXXXXXX`"
>
> if [ "$?" != 0 ]; then
>   /usr/bin/logger -i -p mail.warning -t filter "Unable to create temporary
> file."
>   exit $EX_TEMPFAIL
> fi
>
> # Clean up when done or when aborting.
> trap "rm -f $OUTPUT" EXIT SIGTERM
>
> $SPAMASSASSIN -x -E -u $USER > $OUTPUT
> return="$?"
> if [ "$return" == 1 ]; then
>   $NEW_COMMAND < $OUTPUT
>   exit $?
> elif [ "$return" != 0 ]; then
>   /usr/bin/logger -i -p mail.warning -t filter "Temporary SpamAssassin
> failure (spamc return $return)"
>   exit $EX_TEMPFAIL
> fi
> $SENDMAIL "$@" < $OUTPUT
> exit $?
>
> ------------------------------
>
> --
>
> Neil Lazarow - IT Sales / Systems Engineering
> Naknan, Inc.  IT Solutions
> SDB, HMBC Member
> Minority, Woman-Owned TX HUB
> Cisco Authorized Reseller
> NEC Authorized Reseller
> Phone: 281-990-0030 ext 22
> Fax: 281-990-0033
> nlaza...@naknan.com
>
>



-- 
-Massimiliano Giovine
Aksel Peter Jørgensen dice: "Why make things difficult, when it is
possible to make them cryptic and totally illogic, with just a little
bit more effort?"
Blog: http://opentalking.blogspot.com
"Linus Torvalds doesn't die, he simply returns zero."

Reply via email to