You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by mathiasadsl <ma...@hotmail.com> on 2008/10/21 13:58:38 UTC

Need Help For Redirecting SPAM to a mailbox

Hi all,

I'm currently running a postfix server and spamassassin under Fedora Core 8.
Everyhting is OK but i'd like to redirect tagged [SPAM] mails to a mailbox.

I did the following:

#Edit /etc/postfix/main.cf
header_checks = regexp:/etc/postfix/header_checks

#I Created /etc/postfix/header_checks and added this line:
/^X-Spam-Status:[.*](Yes|YES)/ REDIRECT spambox@mydomain.com


Unfortunately, nothing happened, the target user still receive the mail and
spam is not forwarded to the "garbadge" mail box.

What's wrong with my conf?

postfix-2.4.5-2.fc8
spamassassin-3.2.3-2.fc8
-- 
View this message in context: http://www.nabble.com/Need-Help-For-Redirecting-SPAM-to-a-mailbox-tp20088706p20088706.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.


Re: Need Help For Redirecting SPAM to a mailbox

Posted by Duane Hill <d....@yournetplus.com>.
On Tue, 21 Oct 2008, mathiasadsl wrote:

> Hi all,
>
> I'm currently running a postfix server and spamassassin under Fedora Core 8.
> Everyhting is OK but i'd like to redirect tagged [SPAM] mails to a mailbox.
>
> I did the following:
>
> #Edit /etc/postfix/main.cf
> header_checks = regexp:/etc/postfix/header_checks
>
> #I Created /etc/postfix/header_checks and added this line:
> /^X-Spam-Status:[.*](Yes|YES)/ REDIRECT spambox@mydomain.com

Why not just use the X-Spam-Flag header field:

/^x-spam-flag:\s+yes/ REDIRECT spambox@example.com

By default, Postfix pcre/regexp are case insensitive.

> Unfortunately, nothing happened, the target user still receive the mail and
> spam is not forwarded to the "garbadge" mail box.
>
> What's wrong with my conf?
>
> postfix-2.4.5-2.fc8
> spamassassin-3.2.3-2.fc8
> -- 
> View this message in context: http://www.nabble.com/Need-Help-For-Redirecting-SPAM-to-a-mailbox-tp20088706p20088706.html
> Sent from the SpamAssassin - Users mailing list archive at Nabble.com.
>
>

Re: Need Help For Redirecting SPAM to a mailbox

Posted by Evan Platt <ev...@espphotography.com>.
Why not use procmail or other similar tool?

mathiasadsl wrote:
> Hi all,
>
> I'm currently running a postfix server and spamassassin under Fedora Core 8.
> Everyhting is OK but i'd like to redirect tagged [SPAM] mails to a mailbox.
>
> I did the following:
>
> #Edit /etc/postfix/main.cf
> header_checks = regexp:/etc/postfix/header_checks
>
> #I Created /etc/postfix/header_checks and added this line:
> /^X-Spam-Status:[.*](Yes|YES)/ REDIRECT spambox@mydomain.com
>
>
> Unfortunately, nothing happened, the target user still receive the mail and
> spam is not forwarded to the "garbadge" mail box.
>
> What's wrong with my conf?
>
> postfix-2.4.5-2.fc8
> spamassassin-3.2.3-2.fc8
>   


Re: Need Help For Redirecting SPAM to a mailbox

Posted by Mariusz Kruk <kr...@epsilon.eu.org>.
On wto, 2008-10-21 at 06:39 -0700, mathiasadsl wrote:
> hi Marius,
> 
> I've check the headers of [SPAM] mails: There's X-Spam-Status: Yes.

OK. So the SA seems to be working.

> I'm sorry but i'm not familiar with regular express:

There is quite a lot of information out there about standard regexps as
well as pcre (perl-compatible regular expressions). Just use google, or
even 'man regex' and 'man pcre'

> #/^Subject: [SPAM]*/    REDIRECT spambox@lnxgw.mydomain.com

This probably will match something, but not in the way you think,
because it will be looking for a string starting with "Subject:" then a
space and than one of the letters 'S','P','A' or 'M' repeated zero or
more times. So effectively it will match "Subject: ".

> # /^X-Spam-Flag: YES/   REDIRECT spambox@lnxgw.mydomain.com

This has no fancy regexp at all, so it would match only if you have
literarily that text in headers (with possible whitespaces at the
beginning of the line).

> #/^X-Spam-Status:[.*](Yes|YES)/ REDIRECT spambox@lnxgw.mydomain.com

Hmm... it seems I was mistaken. Modern standard regexp should recognize
(a|b) pattern. But it will expect a dot or a star right between field
name and header content (special characters loose their meaning inside
[])

> You mentionned in your previous mail PCRE, how can i use it or how can i
> adjust my regular expression?

When you define a lookup table you define in which format it is. you
have regexp:/somewhere/something. If you wanted pcre, you'd have yo use
pcre:/somewhere/something. But it seems I was a bit too hasty in my
judgement about that RE. It just seems you're looking for something
different than you want.
Substitute '[.*]' with ' *' and see if it helps.
And please stop topposting!
-- 
[------------------------] And God said, "Let Heisenberg be"... and all
[  Kruk@epsilon.eu.org   ] was uncertain.
[ http://epsilon.eu.org/ ] 
[------------------------] 


Re: Need Help For Redirecting SPAM to a mailbox

Posted by mathiasadsl <ma...@hotmail.com>.
hi Marius,

I've check the headers of [SPAM] mails: There's X-Spam-Status: Yes.

I'm sorry but i'm not familiar with regular express:

#/^Subject: [SPAM]*/    REDIRECT spambox@lnxgw.mydomain.com
# /^X-Spam-Flag: YES/   REDIRECT spambox@lnxgw.mydomain.com
#/^X-Spam-Status:[.*](Yes|YES)/ REDIRECT spambox@lnxgw.mydomain.com

You mentionned in your previous mail PCRE, how can i use it or how can i
adjust my regular expression?

Best regards,

Mathias








Mariusz Kruk wrote:
> 
> First of all, please don't toppost. It's very annoying.
> 
> On wto, 2008-10-21 at 06:04 -0700, mathiasadsl wrote:
>> I just tried your last syntax:
>> /^X-Spam-Status:[.*](Yes|YES)/ REDIRECT spambox@mydomain.com
> 
> It's not my syntax. I pasted it from your mail.
> 
>> It doesnt work, all mails are normally delivered.
> 
> Probably because - as I wrote earlier - they use (Yes|YES) which is a
> pcre syntax, so if you're not using pcre: table, just regexp: table it
> won't match anything.
> 
>> What can I do? Do you need more informations? This is my spamassassin
>> conf:
> 
> Did you check that the mail gets scored in the first place? Did you look
> at headers?
> 
> -- 
> \.\.\.\.\.\.\.\.\.\.\.\.\.\ Heavy  voodoo here. I can't even believe you
> .\.Kruk@epsilon.eu.org.\.\. are reading this.  Are you crazy? Don't even
> \.http://epsilon.eu.org/\.\ think about adjusting these[...](squid.conf)
> .\.\.\.\.\.\.\.\.\.\.\.\.\. 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Need-Help-For-Redirecting-SPAM-to-a-mailbox-tp20088706p20090511.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.


Re: Need Help For Redirecting SPAM to a mailbox

Posted by Mariusz Kruk <kr...@epsilon.eu.org>.
First of all, please don't toppost. It's very annoying.

On wto, 2008-10-21 at 06:04 -0700, mathiasadsl wrote:
> I just tried your last syntax:
> /^X-Spam-Status:[.*](Yes|YES)/ REDIRECT spambox@mydomain.com

It's not my syntax. I pasted it from your mail.

> It doesnt work, all mails are normally delivered.

Probably because - as I wrote earlier - they use (Yes|YES) which is a
pcre syntax, so if you're not using pcre: table, just regexp: table it
won't match anything.

> What can I do? Do you need more informations? This is my spamassassin conf:

Did you check that the mail gets scored in the first place? Did you look
at headers?

-- 
\.\.\.\.\.\.\.\.\.\.\.\.\.\ Heavy  voodoo here. I can't even believe you
.\.Kruk@epsilon.eu.org.\.\. are reading this.  Are you crazy? Don't even
\.http://epsilon.eu.org/\.\ think about adjusting these[...](squid.conf)
.\.\.\.\.\.\.\.\.\.\.\.\.\. 


Re: Need Help For Redirecting SPAM to a mailbox

Posted by mathiasadsl <ma...@hotmail.com>.
I just tried your last syntax:
/^X-Spam-Status:[.*](Yes|YES)/ REDIRECT spambox@mydomain.com

It doesnt work, all mails are normally delivered.

What can I do? Do you need more informations? This is my spamassassin conf:
required_hits 5
report_safe 0
rewrite_header subject [SPAM]
report_header 1



Mariusz Kruk wrote:
> 
> On wto, 2008-10-21 at 05:38 -0700, mathiasadsl wrote:
>> Ok, it's getting better now but all my emails are forwared to
>> spambox@mydomain.com.
>> Even those which are not tagged as  [SPAM]
>> I guess i have some troubles with the regular expression.
>> Can you help me in the syntax issue?
> 
> Well... strange. Because the pattern you specified should match only those
> positively scored. (or having hit some rule with YES in name (I dunno if
> there are any such rules)).
> 
> /^X-Spam-Status:[.*](Yes|YES)/ REDIRECT spambox@mydomain.com
> 
> But it seems you're using pcre but declare it as "normal" regexp. (I
> think pcre introduce the alternative notation with parentheses).
> 
> -- 
>   Kruk@ -\                   | C++  PROGRAMMERS  do it with private
> members
>           }-> epsilon.eu.org | and public objects
> http:// -/                   | 
>                              | 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Need-Help-For-Redirecting-SPAM-to-a-mailbox-tp20088706p20089850.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.


Re: Need Help For Redirecting SPAM to a mailbox

Posted by mouss <mo...@netoyen.net>.
Mariusz Kruk a écrit :
> On wto, 2008-10-21 at 05:38 -0700, mathiasadsl wrote:
>> Ok, it's getting better now but all my emails are forwared to
>> spambox@mydomain.com.
>> Even those which are not tagged as  [SPAM]
>> I guess i have some troubles with the regular expression.
>> Can you help me in the syntax issue?
> 
> Well... strange. Because the pattern you specified should match only those positively scored. (or having hit some rule with YES in name (I dunno if there are any such rules)).
> 

BAYES_00
BAYES_05
BAYES_20
BAYES_40
BAYES_50
BAYES_60
BAYES_80
BAYES_95
BAYES_99

> /^X-Spam-Status:[.*](Yes|YES)/ REDIRECT spambox@mydomain.com
> 

There is no need for the "[.*]" (SA puts the Yes at start), and there is
no need for the (YES|Yes) (by default, header_checks are not case
sensitive).

Use either

/^X-Spam-Flag: Yes/	...

or

/^X-Spam-Status: Yes/

Note that there is no need for (YES|Yes). read postfix documentation to
see why (look for "case").


WARNING. with REDIRECT, you lose the original recipients (you could
retrieve them by parsing the logs, but that's a bit too much).

it is better to use your MDA to do what you want:
- sieve (dovecot, cyrus)
- maildrop
- procmail
...

Alternatively, if you are using amavisd-new (it is the recommended
method to call SA for postfix users), you can configure amavisd-new to
add an extension (+spam for example), then you can simple deliver all
*+spam@example.com to a single mailbox.

> But it seems you're using pcre but declare it as "normal" regexp. (I
> think pcre introduce the alternative notation with parentheses).
> 


Re: Need Help For Redirecting SPAM to a mailbox

Posted by Mariusz Kruk <kr...@epsilon.eu.org>.
On wto, 2008-10-21 at 14:49 +0100, Martin Gregorie wrote:
> > > Ok, it's getting better now but all my emails are forwared to
> > > spambox@mydomain.com.
> > > Even those which are not tagged as  [SPAM]
> > > I guess i have some troubles with the regular expression.
> > > Can you help me in the syntax issue?
> > Well... strange. Because the pattern you specified should match only those positively scored. (or having hit some rule with YES in name (I dunno if there are any such rules)). 
> > /^X-Spam-Status:[.*](Yes|YES)/ REDIRECT spambox@mydomain.com
> Unless my brain is really out to lunch, the problem is the "[.*]".

Yes, seems you're right. I must have slept too little tonight ;-)

> > But it seems you're using pcre but declare it as "normal" regexp. (I
> > think pcre introduce the alternative notation with parentheses).
> The online manual says Postfix can use a POSIX regex or pcre.

Sure, but IIRC you have to tell postfix which form you're using by
putting either pcre: or regexp: in the config.
-- 
/\-\/\-\/\-\/\-\/\-\/\-\/\ I  WILL  NOT  USE  ABBREV.(Bart  Simpson  on
\  Kruk@epsilon.eu.org   / chalkboard in episode 2F33)
/ http://epsilon.eu.org/ \ 
\/-/\/-/\/-/\/-/\/-/\/-/\/ 


Re: Need Help For Redirecting SPAM to a mailbox

Posted by Kai Schaetzl <ma...@conactive.com>.
Mathiasadsl wrote on Tue, 21 Oct 2008 07:05:04 -0700 (PDT):

> It sounds easy but nothing works.

It all depends how and when your SA checks are done. If you are checking 
in the local postfix phase (which will be the case if you are using 
procmail - and you will want to use procmail for this redirection as 
well!) none of this will ever hit. It will only hit if someone sends you a 
mail with such a header.
In other words, if the postman has already delivered the mail to your 
mailbox there is no point in running after him and telling him to please 
put the mail in red envelopes in your neighbour's mailbox. It's too late 
then.

Kai

-- 
Kai Schätzl, Berlin, Germany
Get your web at Conactive Internet Services: http://www.conactive.com




Re: Need Help For Redirecting SPAM to a mailbox

Posted by mouss <mo...@netoyen.net>.
Martin Gregorie a écrit :
> On Tue, 2008-10-21 at 20:01 +0200, mouss wrote:
>> Why do you guys put a '.*' there? This would also match
>>
> Fair cop, guv, on both counts. 
> 
> I spotted that '[.*]' didn't do what the OP wanted and didn't look any
> further. Obviously, 
> 	^X-Spam-Status:[ \t]{1,40}(Yes|YES) 
> 
> is better than my original suggestion since it allows only whitespace
> between the header name and the Yes/No indication. I tested this one in
> grep with the -P flag on (use a Perl regex). It does what the OP
> wanted. 
> 

Is there a variant of SA that puts multiple spaces?

>> Note that it is easier to use X-Spam-Flag if it is available. otherwise,
>>
> I should have mentioned that, since I use it in a program that throws
> spam in the bit bucket. I forgot that X-Spam-Flag exists since it
> doesn't appear in messages SA thinks are non-spam, which is all that
> gets into my mailbox.
> 
>>> X-Spam-Status: No, score=1.9 required=6.0
> This also shows that line wrapping in an incoming X-Spam-Status line may
> cause match failures unless you're sure that something has unpacked the
> entire header into a single string before you apply the regex to it.
>  


Indeed. grep and variants aren't good at mail headers. Fortunately, OP
is using postfix header_checks, which work on "full" headers (folded).
note also that these checks are not case sensitive by default (the /i
modifier works the opposite way).

Re: Need Help For Redirecting SPAM to a mailbox

Posted by Martin Gregorie <ma...@gregorie.org>.
On Tue, 2008-10-21 at 20:01 +0200, mouss wrote:
> Why do you guys put a '.*' there? This would also match
> 
Fair cop, guv, on both counts. 

I spotted that '[.*]' didn't do what the OP wanted and didn't look any
further. Obviously, 
	^X-Spam-Status:[ \t]{1,40}(Yes|YES) 

is better than my original suggestion since it allows only whitespace
between the header name and the Yes/No indication. I tested this one in
grep with the -P flag on (use a Perl regex). It does what the OP
wanted. 

> Note that it is easier to use X-Spam-Flag if it is available. otherwise,
> 
I should have mentioned that, since I use it in a program that throws
spam in the bit bucket. I forgot that X-Spam-Flag exists since it
doesn't appear in messages SA thinks are non-spam, which is all that
gets into my mailbox.

> > X-Spam-Status: No, score=1.9 required=6.0
>
This also shows that line wrapping in an incoming X-Spam-Status line may
cause match failures unless you're sure that something has unpacked the
entire header into a single string before you apply the regex to it.
 
Martin



Re: Need Help For Redirecting SPAM to a mailbox

Posted by mouss <mo...@netoyen.net>.
Martin Gregorie a écrit :
> On Tue, 2008-10-21 at 07:05 -0700, mathiasadsl wrote:
> 
>> OK, i've just tried your new regular expression but it doesnt work better.
>> Nothing happened. The email is still tagged as [SPAM] and is delivered to
>> user.
>>
> That's odd. I've just run the following:
> 
> [kiwi@zappa ~]$ grep '^X-Spam-Status:.*\(No\|NO\)' x.txt 

Why do you guys put a '.*' there? This would also match

X-Spam-Status: Yes, ..... REFINANCE_NOW ...

and a lot more...

Note that it is easier to use X-Spam-Flag if it is available. otherwise,

$ egrep -i '^X-Spam-Status: No" x.txt


> X-Spam-Status: No, score=1.9 required=6.0
> [snip]

Re: Need Help For Redirecting SPAM to a mailbox

Posted by Martin Gregorie <ma...@gregorie.org>.
On Tue, 2008-10-21 at 07:05 -0700, mathiasadsl wrote:

> OK, i've just tried your new regular expression but it doesnt work better.
> Nothing happened. The email is still tagged as [SPAM] and is delivered to
> user.
> 
That's odd. I've just run the following:

[kiwi@zappa ~]$ grep '^X-Spam-Status:.*\(No\|NO\)' x.txt 
X-Spam-Status: No, score=1.9 required=6.0
[kiwi@zappa ~]$

against a saved copy of your message. Grep requires (, ) and | to be
escaped and I reversed the flag state because your message isn't spam.

The only thing I can thing of is to repeat the question somebody else
asked: how are you invoking SA and are you sure it gets invoked before
Postfix forwards the message to spambox@mydomain.com 

IIRC the Postfix manual doesn't help here, but looking
at /var/log/maillog traces Postfix operations and may well show the
order in which things are done? 

I'd look at my log but it will be no help at all because I pick up mail
with fetchmail, which pipes it through spamc before sending it to
Postfix for distribution.

If there's not enough detail in the mail log, try making Postfix more
verbose. http://www.postfix.org/DEBUG_README.html shows how to trace
individual test messages and how to make all the Postfix daemons
generate more logging information. I don't think what gets logged is
important - you just need to see the order in which the various Postfix
processes and SA act as a message is processed.

> How can i write with regular expression the following?
> "If [SPAM] is included in the subjet Redirect to spambox@....".
> 
Something like:

/^Subject:.*\[SPAM\]/

should do that, but my guess is that won't work any better. You need to
be certain that SA is run before the message is passed to the re-routing
filter before playing round with the regex.

Martin



Re: Need Help For Redirecting SPAM to a mailbox

Posted by mathiasadsl <ma...@hotmail.com>.


Martin Gregorie-2 wrote:
> 
> On Tue, 2008-10-21 at 14:58 +0200, Mariusz Kruk wrote:
>> On wto, 2008-10-21 at 05:38 -0700, mathiasadsl wrote:
>> > Ok, it's getting better now but all my emails are forwared to
>> > spambox@mydomain.com.
>> > Even those which are not tagged as  [SPAM]
>> > I guess i have some troubles with the regular expression.
>> > Can you help me in the syntax issue?
>> 
>> Well... strange. Because the pattern you specified should match only
>> those positively scored. (or having hit some rule with YES in name (I
>> dunno if there are any such rules)).
>> 
>> /^X-Spam-Status:[.*](Yes|YES)/ REDIRECT spambox@mydomain.com
>> 
> Unless my brain is really out to lunch, the problem is the "[.*]". This
> matches a single character which may be a stop or an asterisk. Try the
> following:
> 
> /^X-Spam-Status:.*(Yes|YES)/ REDIRECT spambox@mydomain.com
> 
>> But it seems you're using pcre but declare it as "normal" regexp. (I
>> think pcre introduce the alternative notation with parentheses).
>> 
> The online manual says Postfix can use a POSIX regex or pcre.
> 
> 
> Martin
> 
> 
> 
> 


OK, i've just tried your new regular expression but it doesnt work better.
Nothing happened. The email is still tagged as [SPAM] and is delivered to
user.

How can i write with regular expression the following?
"If [SPAM] is included in the subjet Redirect to spambox@....".

It sounds easy but nothing works.

Best regards,
Mathias

-- 
View this message in context: http://www.nabble.com/Need-Help-For-Redirecting-SPAM-to-a-mailbox-tp20088706p20090989.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.


Re: Need Help For Redirecting SPAM to a mailbox

Posted by Martin Gregorie <ma...@gregorie.org>.
On Tue, 2008-10-21 at 14:58 +0200, Mariusz Kruk wrote:
> On wto, 2008-10-21 at 05:38 -0700, mathiasadsl wrote:
> > Ok, it's getting better now but all my emails are forwared to
> > spambox@mydomain.com.
> > Even those which are not tagged as  [SPAM]
> > I guess i have some troubles with the regular expression.
> > Can you help me in the syntax issue?
> 
> Well... strange. Because the pattern you specified should match only those positively scored. (or having hit some rule with YES in name (I dunno if there are any such rules)).
> 
> /^X-Spam-Status:[.*](Yes|YES)/ REDIRECT spambox@mydomain.com
> 
Unless my brain is really out to lunch, the problem is the "[.*]". This
matches a single character which may be a stop or an asterisk. Try the
following:

/^X-Spam-Status:.*(Yes|YES)/ REDIRECT spambox@mydomain.com

> But it seems you're using pcre but declare it as "normal" regexp. (I
> think pcre introduce the alternative notation with parentheses).
> 
The online manual says Postfix can use a POSIX regex or pcre.


Martin



Re: Need Help For Redirecting SPAM to a mailbox

Posted by Mariusz Kruk <kr...@epsilon.eu.org>.
On wto, 2008-10-21 at 05:38 -0700, mathiasadsl wrote:
> Ok, it's getting better now but all my emails are forwared to
> spambox@mydomain.com.
> Even those which are not tagged as  [SPAM]
> I guess i have some troubles with the regular expression.
> Can you help me in the syntax issue?

Well... strange. Because the pattern you specified should match only those positively scored. (or having hit some rule with YES in name (I dunno if there are any such rules)).

/^X-Spam-Status:[.*](Yes|YES)/ REDIRECT spambox@mydomain.com

But it seems you're using pcre but declare it as "normal" regexp. (I
think pcre introduce the alternative notation with parentheses).

-- 
  Kruk@ -\                   | C++  PROGRAMMERS  do it with private members
          }-> epsilon.eu.org | and public objects
http:// -/                   | 
                             | 


Re: Need Help For Redirecting SPAM to a mailbox

Posted by mathiasadsl <ma...@hotmail.com>.
Ok, it's getting better now but all my emails are forwared to
spambox@mydomain.com.
Even those which are not tagged as  [SPAM]
I guess i have some troubles with the regular expression.
Can you help me in the syntax issue?




Mariusz Kruk wrote:
> 
> On wto, 2008-10-21 at 04:58 -0700, mathiasadsl wrote:
>> Hi all,
>> 
>> I'm currently running a postfix server and spamassassin under Fedora Core
>> 8.
>> Everyhting is OK but i'd like to redirect tagged [SPAM] mails to a
>> mailbox.
>> 
>> I did the following:
>> 
>> #Edit /etc/postfix/main.cf
>> header_checks = regexp:/etc/postfix/header_checks
>> 
>> #I Created /etc/postfix/header_checks and added this line:
>> /^X-Spam-Status:[.*](Yes|YES)/ REDIRECT spambox@mydomain.com
>> 
>> 
>> Unfortunately, nothing happened, the target user still receive the mail
>> and
>> spam is not forwarded to the "garbadge" mail box.
> 
> Are you sure that header checks are done _after_ the message has been
> filtered thru SA? Where do you invoke SA?
> -- 
> /\-\/\-\/\-\/\-\/\-\/\-\/\ The  macro here has not been followed by the
> \  Kruk@epsilon.eu.org   / required stuff, so I'm ignorig it.(TeX)
> / http://epsilon.eu.org/ \ 
> \/-/\/-/\/-/\/-/\/-/\/-/\/ 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Need-Help-For-Redirecting-SPAM-to-a-mailbox-tp20088706p20089289.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.


Re: Need Help For Redirecting SPAM to a mailbox

Posted by Mariusz Kruk <kr...@epsilon.eu.org>.
On wto, 2008-10-21 at 04:58 -0700, mathiasadsl wrote:
> Hi all,
> 
> I'm currently running a postfix server and spamassassin under Fedora Core 8.
> Everyhting is OK but i'd like to redirect tagged [SPAM] mails to a mailbox.
> 
> I did the following:
> 
> #Edit /etc/postfix/main.cf
> header_checks = regexp:/etc/postfix/header_checks
> 
> #I Created /etc/postfix/header_checks and added this line:
> /^X-Spam-Status:[.*](Yes|YES)/ REDIRECT spambox@mydomain.com
> 
> 
> Unfortunately, nothing happened, the target user still receive the mail and
> spam is not forwarded to the "garbadge" mail box.

Are you sure that header checks are done _after_ the message has been
filtered thru SA? Where do you invoke SA?
-- 
/\-\/\-\/\-\/\-\/\-\/\-\/\ The  macro here has not been followed by the
\  Kruk@epsilon.eu.org   / required stuff, so I'm ignorig it.(TeX)
/ http://epsilon.eu.org/ \ 
\/-/\/-/\/-/\/-/\/-/\/-/\/