From: (no name) (no email)
Date: Wed Nov 01 2006 - 08:35:02 EST
Quoting mouss <>:
> wrote:
> > Quoting Sandy Drobic <>:
> >
> >
> >> wrote:
> >>
> >>> Hi,
> >>>
> >>> Im looking to prepend [SPAM] to the Subject: of mails that come in with a preassigned X-SpamReason: value of 1..4.
> >>>
> >>> main.cf:header_checks = pcre:/etc/postfix/header_checks
> >>>
> >>> And in header_checks:
> >>> /X-SpamReason: Yes, hits=([1..4]\.[0-9]*).*required/ PREPEND Subject: [SPAM]
> >>>
> >>> However this is overwriting the Subject completely, and Im just getting [SPAM] in the Subject of the mail
> >>> once its received.
> >>>
> >>> Any idea what I could be doing wrong ?
> >>>
> >> Prepend sets a new Subject header here. This is better done by your filter
> >> software. Header_checks can't set a subject header in relation to another
> >> check on x-spamreason.
> >>
> >> You either need a filter for that or do it directly in your spamfilter.
> >>
> >
> > I see, thanks for the explanation.
> >
>
> you can use procmail|maildrop with formail|reformail.
>
> it is possible to with postfix but that would be overkill (run a
> specific smtpd as a content_filter, using the FILTER statement in place
> of your PREPEND. then that smtpd will have its own cleanup to modify the
> subject).
>
The postfix server in question simply passes inbound valid mail to our exchange server
and passes outbound mail to an external mail service run by messagelabs, messagelabs
then passes it on to the outside world.
It's the messagelabs server that puts in the X-SpamReason header. I need to catch
this X-SpamReason value and if it's >0 & <= 4 do nothing with it, just pass it
onto exchange.
If the X-SpamReason header value is > 4 & < 7 prepend the subject with [SPAM] and
pass it to exchange as normal, letting the user set a rule in outlook for this if
they wish.
X-SpamReason > 7 will result in the mail getting redirected to a quarantine address
in exchange.
I've tried to google software that will let me do this, but I'm not having much luck.
I had thought about setting up my own content_filter but like yourself I considered it
overkill.
Would procmail/maildrop work with the situation I described above ? I don't have any
experience of procmail or maildrop.
If anyone knows any software which will do what I'd appreciate a heads up. We aren't doing
our own spam/virus scanning so I can't rewrite the subject with spamassassin.
Thanks,
Nick .
|
|
|