You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Mike Galvez <mi...@outawhack.net> on 2006/04/23 06:54:18 UTC
Adding headers from SQL userprefs
Hello,
I have searched the archives, but I can't find an answer to why I
can't add headers such as "X-Spam-Score".
I'm using SpamAssassin 3.1.1, Sendmail and spamass-milter-0.3.0_1
My local.cf has:
add_header all Score _SCORE_
version=_VERSION_
add_header spam Flag _YESNOCAPS_
report_safe 2
lock_method flock
required_score 5.5
use_bayes 1
bayes_auto_learn 1
bayes_ignore_header X-Bogosity
bayes_ignore_header X-Spam-Flag
bayes_ignore_header X-Spam-Status
In the headers, I get:
X-Spam-Level: *********
X-Spam-Status: Yes, score=9.2 required=5.5 tests=AWL=-0.591,
DRUGS_ERECTILE=0.1,DRUGS_ERECTILE_OBFU=2.046,GAPPY_SUBJECT=1.625,
MANY_EXCLAMATIONS=0,PLING_PLING=0.461,SUBJECT_DRUG_GAP_C=2.88,
SUBJECT_FUZZY_VPILL=1.644,UPPERCASE_75_100=1.04 autolearn=no
version=3.1.1
X-Spam-Flag: YES
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on
But no X-Spam-Score
I am pulling in user_pref rules from an sql database. Using debug,
I know it's checking the sql table and parsing rules. The only pref
in the sql table that affects the header is:
rewrite_header Subject [SPAM-_HITS_]-
I appreciate any help you can provide.
Thanks
--
Michael Galvez
Q: How did you get into artificial intelligence?
A: Seemed logical -- I didn't have any real intelligence.
Re: Adding headers from SQL userprefs
Posted by Matt Kettler <mk...@comcast.net>.
John Andersen wrote:
> On Saturday 22 April 2006 08:54 pm, Mike Galvez wrote:
>
>
>> X-Spam-Status: Yes, score=9.2
>>
> ...
>
>> But no X-Spam-Score
>>
>
> Score was 9.2.
> Its right there in X-Spam-Status
>
>
Yes John, but his point is there should also be an X-Spam-Score header
right under it. It's npt that the score isn't reported, it's that the
headers he told SA to create are not being created.
This config line should cause an X-Spam-Score: header to be created:
add_header all Score _SCORE_
Re: Adding headers from SQL userprefs
Posted by John Andersen <js...@pen.homeip.net>.
On Saturday 22 April 2006 08:54 pm, Mike Galvez wrote:
> X-Spam-Status: Yes, score=9.2
...
> But no X-Spam-Score
Score was 9.2.
Its right there in X-Spam-Status
--
_____________________________________
John Andersen
Re: Adding headers from SQL userprefs
Posted by Mike Galvez <mi...@outawhack.net>.
On Sun, Apr 23, 2006 at 06:05:31PM -0700, jdow wrote:
> From: "Mike Galvez" <mi...@outawhack.net>
>
> >On Sun, Apr 23, 2006 at 03:38:21PM -0700, Loren Wilton wrote:
> >>> I did this and the "X-Spam-Score" was listed, so something (maybe
> >>Milter)
> >>is
> >>> not writing it, though Milter changes the Subject header...
> >>
> >>That may be your problem. Several integration tools ignore the headers SA
> >>makes and rewrite the message using their own headers. Maybe you are
> >>using
> >>one of them.
> >>
> >> Loren
> >>
> >
> >After digging a little deeper, this appears to be the case. I'm using
> >Cyrus Imap
> >with sendmail, spamassassin with MySQL for user_prefs and spamass-milter.
> >
> >I would be interested in what others with similar setups are using to call
> >spamc|spamd if not using spamass-milter.
>
> I have Loren and myself on a plain old diet of procmail. It's dumb. It's
> arcane. It's all manner of ugliness. It works wonderfully. And it is, for
> all its silliness, quite amenable to my own silliness. The mail server
> sits about 2 feet from me. So I have arranged my .procmailrc file to play
> a specific "odd sound" when Loren sends me email and another when I get
> customer email. Once you start to understand procmail such silliness
> becomes quite practical. And I haven't even delved into the deeper levels
> of procmail's grubbier arcanities. I surely hope it does not die out.
>
> {^_-} Joanne
I like and (used) procmail for a long time, but I have not found a graceful way
of using it with Cyrus deliver.
--
Michael Galvez
Profanity is the one language all programmers know best.
Re: Adding headers from SQL userprefs
Posted by jdow <jd...@earthlink.net>.
From: "Mike Galvez" <mi...@outawhack.net>
> On Sun, Apr 23, 2006 at 03:38:21PM -0700, Loren Wilton wrote:
>> > I did this and the "X-Spam-Score" was listed, so something (maybe Milter)
>> is
>> > not writing it, though Milter changes the Subject header...
>>
>> That may be your problem. Several integration tools ignore the headers SA
>> makes and rewrite the message using their own headers. Maybe you are using
>> one of them.
>>
>> Loren
>>
>
> After digging a little deeper, this appears to be the case. I'm using Cyrus Imap
> with sendmail, spamassassin with MySQL for user_prefs and spamass-milter.
>
> I would be interested in what others with similar setups are using to call spamc|spamd
> if not using spamass-milter.
I have Loren and myself on a plain old diet of procmail. It's dumb. It's
arcane. It's all manner of ugliness. It works wonderfully. And it is, for
all its silliness, quite amenable to my own silliness. The mail server
sits about 2 feet from me. So I have arranged my .procmailrc file to play
a specific "odd sound" when Loren sends me email and another when I get
customer email. Once you start to understand procmail such silliness
becomes quite practical. And I haven't even delved into the deeper levels
of procmail's grubbier arcanities. I surely hope it does not die out.
{^_-} Joanne
Re: Adding headers from SQL userprefs
Posted by John Rudd <jr...@ucsc.edu>.
On Apr 23, 2006, at 4:08 PM, Mike Galvez wrote:
> On Sun, Apr 23, 2006 at 03:38:21PM -0700, Loren Wilton wrote:
>>> I did this and the "X-Spam-Score" was listed, so something (maybe
>>> Milter)
>> is
>>> not writing it, though Milter changes the Subject header...
>>
>> That may be your problem. Several integration tools ignore the
>> headers SA
>> makes and rewrite the message using their own headers. Maybe you are
>> using
>> one of them.
>>
>> Loren
>>
>
> After digging a little deeper, this appears to be the case. I'm using
> Cyrus Imap
> with sendmail, spamassassin with MySQL for user_prefs and
> spamass-milter.
>
> I would be interested in what others with similar setups are using to
> call spamc|spamd
> if not using spamass-milter.
>
I use mimedefang to call SpamAssassin. If you know perl, you can
modify the customizable part (mimedefang-filter) to make exactly the
header entries you want.
There's also a non-milter (uses an incoming mailq and an outgoing
mailq) that works with sendmail and a few other MTA's. It's called
mailscanner (www.mailscanner.info). Has tons of features, great
support, but not as flexible as mimedefang. And, because it runs in a
dual queue mode, instead of as a milter, it can't reject messages
_during_ the SMTP transaction. (that's why I've been switching away
from it)
RE: Adding headers from SQL userprefs
Posted by Gaute Lund <ga...@idrift.no>.
> > That may be your problem. Several integration tools ignore the
> > headers SA makes and rewrite the message using their own headers.
> > Maybe you are using one of them.
> >
>
> After digging a little deeper, this appears to be the case.
> I'm using Cyrus Imap with sendmail, spamassassin with MySQL
> for user_prefs and spamass-milter.
>
> I would be interested in what others with similar setups are
> using to call spamc|spamd if not using spamass-milter.
I use postfix + cyrus-imapd myself, and use amavisd-new to call spamassassin
'directly', no spamd, (and it also calls clamav). This works wonderfully, both
robust and flexible. I don't use mysql though, but I see it appears in the
config files and is apparently available.
Med vennleg helsing / Best regards
Gaute Lund
IT consultant
iDrift AS
Phone: (+47) 53 47 22 00
Fax: (+47) 53 47 22 01
Mobile: (+47) 97 00 82 00
Re: Adding headers from SQL userprefs
Posted by Mike Galvez <mi...@outawhack.net>.
On Sun, Apr 23, 2006 at 03:38:21PM -0700, Loren Wilton wrote:
> > I did this and the "X-Spam-Score" was listed, so something (maybe Milter)
> is
> > not writing it, though Milter changes the Subject header...
>
> That may be your problem. Several integration tools ignore the headers SA
> makes and rewrite the message using their own headers. Maybe you are using
> one of them.
>
> Loren
>
After digging a little deeper, this appears to be the case. I'm using Cyrus Imap
with sendmail, spamassassin with MySQL for user_prefs and spamass-milter.
I would be interested in what others with similar setups are using to call spamc|spamd
if not using spamass-milter.
Thanks
--
Michael Galvez
Re: Adding headers from SQL userprefs
Posted by Loren Wilton <lw...@earthlink.net>.
> I did this and the "X-Spam-Score" was listed, so something (maybe Milter)
is
> not writing it, though Milter changes the Subject header...
That may be your problem. Several integration tools ignore the headers SA
makes and rewrite the message using their own headers. Maybe you are using
one of them.
Loren
Re: Adding headers from SQL userprefs
Posted by Mike Galvez <mi...@outawhack.net>.
On Sun, Apr 23, 2006 at 09:02:19AM -0400, Matt Kettler wrote:
> Mike Galvez wrote:
> > Hello,
> >
> > I have searched the archives, but I can't find an answer to why I
> > can't add headers such as "X-Spam-Score".
> >
> > I'm using SpamAssassin 3.1.1, Sendmail and spamass-milter-0.3.0_1
> >
> > My local.cf has:
> >
> > add_header all Score _SCORE_
> > version=_VERSION_
> > add_header spam Flag _YESNOCAPS_
> > report_safe 2
> > lock_method flock
> > required_score 5.5
> > use_bayes 1
> > bayes_auto_learn 1
> > bayes_ignore_header X-Bogosity
> > bayes_ignore_header X-Spam-Flag
> > bayes_ignore_header X-Spam-Status
> >
> >
> > In the headers, I get:
> >
> > X-Spam-Level: *********
> > X-Spam-Status: Yes, score=9.2 required=5.5 tests=AWL=-0.591,
> > DRUGS_ERECTILE=0.1,DRUGS_ERECTILE_OBFU=2.046,GAPPY_SUBJECT=1.625,
> > MANY_EXCLAMATIONS=0,PLING_PLING=0.461,SUBJECT_DRUG_GAP_C=2.88,
> > SUBJECT_FUZZY_VPILL=1.644,UPPERCASE_75_100=1.04 autolearn=no
> > version=3.1.1
> > X-Spam-Flag: YES
> > X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on
> >
> > But no X-Spam-Score
> >
>
> Mike:
>
> 1) have you run spamassassin --lint? I strongly suspect that
> "version=_VERSION_" line is going to cause parse errors. You need
> another add_header statement in front of it.
That line was a wrap from a commented line I removed before I mailed this, but
I missed it. spamassassin --lint did not spew any warnings.
>
> 2) test by piping a text file of message into the plain "spamassassin"
> script. You can use the sample-spam.txt that comes with the SA tarball
> if you don't have any other complete messages laying about.
I did this and the "X-Spam-Score" was listed, so something (maybe Milter) is
not writing it, though Milter changes the Subject header...
add_header all Score _SCORE_ is in local.cf, SQL mail_prefs, and base rules
directory /usr/local/share/spamassassin/10_misc.cf
I'm still looking, and thanks for the suggestions.
-Mike
>
> 3) After you've linted and tested, then restart spamd. The changes won't
> be picked up by any tools using spamd until spamd reloads.
>
--
Michael Galvez
Outawhack.net www.outawhack.net
434-295-0593 mike@outawhack.net
There was a young girl in Dakota
Had a letter from Ickes; he wrote her:
"In addition to gas
We are rationing ass,
And you've greatly exceeded your quota."
Re: Adding headers from SQL userprefs
Posted by Matt Kettler <mk...@comcast.net>.
Mike Galvez wrote:
> Hello,
>
> I have searched the archives, but I can't find an answer to why I
> can't add headers such as "X-Spam-Score".
>
> I'm using SpamAssassin 3.1.1, Sendmail and spamass-milter-0.3.0_1
>
> My local.cf has:
>
> add_header all Score _SCORE_
> version=_VERSION_
> add_header spam Flag _YESNOCAPS_
> report_safe 2
> lock_method flock
> required_score 5.5
> use_bayes 1
> bayes_auto_learn 1
> bayes_ignore_header X-Bogosity
> bayes_ignore_header X-Spam-Flag
> bayes_ignore_header X-Spam-Status
>
>
> In the headers, I get:
>
> X-Spam-Level: *********
> X-Spam-Status: Yes, score=9.2 required=5.5 tests=AWL=-0.591,
> DRUGS_ERECTILE=0.1,DRUGS_ERECTILE_OBFU=2.046,GAPPY_SUBJECT=1.625,
> MANY_EXCLAMATIONS=0,PLING_PLING=0.461,SUBJECT_DRUG_GAP_C=2.88,
> SUBJECT_FUZZY_VPILL=1.644,UPPERCASE_75_100=1.04 autolearn=no
> version=3.1.1
> X-Spam-Flag: YES
> X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on
>
> But no X-Spam-Score
>
Mike:
1) have you run spamassassin --lint? I strongly suspect that
"version=_VERSION_" line is going to cause parse errors. You need
another add_header statement in front of it.
2) test by piping a text file of message into the plain "spamassassin"
script. You can use the sample-spam.txt that comes with the SA tarball
if you don't have any other complete messages laying about.
3) After you've linted and tested, then restart spamd. The changes won't
be picked up by any tools using spamd until spamd reloads.
Re: Adding headers from SQL userprefs
Posted by Mike Galvez <mi...@outawhack.net>.
On Sun, Apr 23, 2006 at 11:23:49AM +0200, mouss wrote:
> Mike Galvez wrote:
> >Hello,
> >
> >I have searched the archives, but I can't find an answer to why I
> >can't add headers such as "X-Spam-Score".
> >
> >I'm using SpamAssassin 3.1.1, Sendmail and spamass-milter-0.3.0_1
> >
> >My local.cf has:
> >
> >add_header all Score _SCORE_
> >version=_VERSION_
> >add_header spam Flag _YESNOCAPS_
> >report_safe 2
> >lock_method flock
> >required_score 5.5
> >use_bayes 1
> >bayes_auto_learn 1
> >bayes_ignore_header X-Bogosity
> >bayes_ignore_header X-Spam-Flag
> >bayes_ignore_header X-Spam-Status
> >
> >
> >In the headers, I get:
> >
> >X-Spam-Level: *********
> >X-Spam-Status: Yes, score=9.2 required=5.5 tests=AWL=-0.591,
> > DRUGS_ERECTILE=0.1,DRUGS_ERECTILE_OBFU=2.046,GAPPY_SUBJECT=1.625,
> > MANY_EXCLAMATIONS=0,PLING_PLING=0.461,SUBJECT_DRUG_GAP_C=2.88,
> > SUBJECT_FUZZY_VPILL=1.644,UPPERCASE_75_100=1.04 autolearn=no
> > version=3.1.1
> >X-Spam-Flag: YES
> >X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on
> >
> >But no X-Spam-Score
> >
> >
> Did you try it manually (spamassassin -t < message.eml)? if it works
> manually, then you probably need to restart something for the change to
> take effect.
Thanks for the reply and suggestion.
Using cat spam1.txt | spamc -u username, I see that the "X-Spam-Score" is written:
From: "Creativity Courses <contact@roadstocreation.com" <co...@roadstocreation.com>
To: nobod@not-here.comu
Subject: [SPAM-13.6]- $100 off Early Registration Promotion expires soon
Date: Tue, 10 Jan 2006 12:46:57 +0000 (GMT)
Message-Id: <20...@ais.com.sg>
X-Spam-Score: 13.6
X-Spam-Flag: YES
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on
X-Spam-Level: *************
X-Spam-score: 13.6
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_444BA993.2FBD218F"
Sending from another domain I see that Milter is not adding the "X-Spam-Score" header
sm-mta[42788]: k3NHW0wP042788: Milter add: header: X-Spam-Flag: YES
sm-mta[42788]: k3NHW0wP042788: Milter add: header: X-Spam-Level: **********
sm-mta[42788]: k3NHW0wP042788: Milter add: header: X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on
sm-mta[42788]: k3NHW0wP042788: Milter change: header Subject: from Buy Them Now! to [SPAM-10.5]- Buy Them Now!
sm-mta[42788]: k3NHW0wP042788: Milter add: header: Content-Type: multipart/mixed; boundary="----------=_444BBA16.97D41A46"
sm-mta[42788]: k3NHW0wP042788: Milter message: body replaced
>
> >I am pulling in user_pref rules from an sql database. Using debug,
> >I know it's checking the sql table and parsing rules. The only pref
> >in the sql table that affects the header is:
> >rewrite_header Subject [SPAM-_HITS_]-
> >
> >I appreciate any help you can provide.
> >
> >Thanks
> >
> >
>
--
Michael Galvez
Re: Adding headers from SQL userprefs
Posted by mouss <mo...@netoyen.net>.
Mike Galvez wrote:
> Hello,
>
> I have searched the archives, but I can't find an answer to why I
> can't add headers such as "X-Spam-Score".
>
> I'm using SpamAssassin 3.1.1, Sendmail and spamass-milter-0.3.0_1
>
> My local.cf has:
>
> add_header all Score _SCORE_
> version=_VERSION_
> add_header spam Flag _YESNOCAPS_
> report_safe 2
> lock_method flock
> required_score 5.5
> use_bayes 1
> bayes_auto_learn 1
> bayes_ignore_header X-Bogosity
> bayes_ignore_header X-Spam-Flag
> bayes_ignore_header X-Spam-Status
>
>
> In the headers, I get:
>
> X-Spam-Level: *********
> X-Spam-Status: Yes, score=9.2 required=5.5 tests=AWL=-0.591,
> DRUGS_ERECTILE=0.1,DRUGS_ERECTILE_OBFU=2.046,GAPPY_SUBJECT=1.625,
> MANY_EXCLAMATIONS=0,PLING_PLING=0.461,SUBJECT_DRUG_GAP_C=2.88,
> SUBJECT_FUZZY_VPILL=1.644,UPPERCASE_75_100=1.04 autolearn=no
> version=3.1.1
> X-Spam-Flag: YES
> X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on
>
> But no X-Spam-Score
>
>
Did you try it manually (spamassassin -t < message.eml)? if it works
manually, then you probably need to restart something for the change to
take effect.
> I am pulling in user_pref rules from an sql database. Using debug,
> I know it's checking the sql table and parsing rules. The only pref
> in the sql table that affects the header is:
> rewrite_header Subject [SPAM-_HITS_]-
>
> I appreciate any help you can provide.
>
> Thanks
>
>