You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Massimiliano Giovine <ev...@gmail.com> on 2010/12/02 08:34:58 UTC
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
Re: Discard spam messages
Posted by Massimiliano Giovine <ev...@gmail.com>.
I saw that spamassassin returns also a flag "Spam-Flag:TRUE" if score
is more than theresold. How can i handle this flag?
2010/12/2 John Wilcock <jo...@tradoc.fr>:
> Le 02/12/2010 09:57, Massimiliano Giovine a écrit :
>>
>> No chance to reproduce this beavior with postfix?
>
> Not with postfix on its own, no. SpamAssassin returns a score, you decide
> what action to take.
>
> There are various "glue" systems to do this for you. My personal
> recommendation would be MailScanner, though both amavisd-new as mentioned by
> Florian is also popular.
>
> John.
>
> --
> -- Over 4000 webcams from ski resorts around the world - www.snoweye.com
> -- Translate your technical documents and web pages - www.tradoc.fr
>
--
-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."
Re: Discard spam messages
Posted by John Wilcock <jo...@tradoc.fr>.
Le 02/12/2010 09:57, Massimiliano Giovine a écrit :
> No chance to reproduce this beavior with postfix?
Not with postfix on its own, no. SpamAssassin returns a score, you
decide what action to take.
There are various "glue" systems to do this for you. My personal
recommendation would be MailScanner, though both amavisd-new as
mentioned by Florian is also popular.
John.
--
-- Over 4000 webcams from ski resorts around the world - www.snoweye.com
-- Translate your technical documents and web pages - www.tradoc.fr
Re: Discard spam messages
Posted by Massimiliano Giovine <ev...@gmail.com>.
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 <nl...@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 <nl...@naknan.com>:
>>
>>>
>>> Massimiliano Giovine wrote:
>>>
>>>>
>>>> No chance to reproduce this beavior with postfix?
>>>>
>>>> 2010/12/2 Florian Thiessenhusen <Fl...@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:evocthurner@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
>>> nlazarow@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
> nlazarow@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."
Re: Discard spam messages
Posted by Massimiliano Giovine <ev...@gmail.com>.
No chance to reproduce this beavior with postfix?
2010/12/2 Florian Thiessenhusen <Fl...@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:evocthurner@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
>
--
-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."
AW: Discard spam messages
Posted by Florian Thiessenhusen <Fl...@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:evocthurner@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
Re: Discard spam messages
Posted by Benny Pedersen <me...@junc.org>.
On tor 02 dec 2010 08:34:58 CET, Massimiliano Giovine wrote
> i'm writing here because i'd like to have a certain behavior from spamd.
spamd only tags mails, not deliver or discard
> I wrote a plugin that assign 10 pt to a mail message:
> when i manually run spamassassin it says "hey that's spam".
that part is ok
> How can i tell to spamd to automatically discard this item?
spamd cant do this
> For "automatically discard" i mean, "do not deliver it to user mailbox".
google spamas-milter or better spampd and integrade one of them into the mta
> What do i have to do?
read the docs on spamas-milter and or spampd, dont install one before
you have done this
--
xpoint http://www.unicom.com/pw/reply-to-harmful.html