You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by christophe <ch...@free.fr> on 2005/07/25 00:31:46 UTC

spamc doesn't add headers

I spent my last days googling, reading tutorials, man pages and spamassassin
web sites and tried many differents settings for spamassassin (version 3.0.4)
but without success. So i have no other solutions than asking you.

Here is the content of my /etc/mail/spamassassin/local.cf file :
----------------------------------------------
required_hits 5
report_safe 0
add_header spam Flag _YESNOCAPS_
add_header all Status _YESNO_, score=_SCORE_ required=_REQD_ tests=_TESTS_
autolearn=_AUTOLEARN_ version=_VERSION_
add_header all Level _STARS(*)_
add_header all Checker-Version SpamAssassin _VERSION_ (_SUBVERSION_) on
_HOSTNAME_
auto_whitelist_path        /var/spool/spamassassin/auto-whitelist
auto_whitelist_file_mode   0666
dcc_home                   /var/lib/dcc
----------------------------------------------

spamd is running perfectly as a daemon.
I copied a spam mail in the file 'spam'.
And there i meet a _very_ weird paradox.
If i run one of these 2 commands :

$spamassassin < spam
$spamc -E < spam

i get an output with 'X-Spam-Flag: YES', which is what i want to treat the
email with my maler.
But when i run :

$cat spam

No line with 'X-Spam-Flag: YES' appears. Yet, i thought my config file was
well written. because i put this line :

add_header spam Flag _YESNOCAPS_

I don't understand why no header is added in the 'spam' file
There must something i forgot.
Could anyone help me, please ?


--
Christophe

Re: spamc doesn't add headers

Posted by Theo Van Dinter <fe...@apache.org>.
On Mon, Jul 25, 2005 at 12:31:46AM +0200, christophe wrote:
> spamd is running perfectly as a daemon.
> I copied a spam mail in the file 'spam'.

Ok.

> If i run one of these 2 commands :
> $spamassassin < spam
> $spamc -E < spam
> i get an output with 'X-Spam-Flag: YES', which is what i want to treat the
> email with my maler.

Right, the message is displayed on STDOUT w/ markup and everything.

> But when i run :
> $cat spam
> No line with 'X-Spam-Flag: YES' appears.

Of course not.  "spam" is the original file without markup.

> I don't understand why no header is added in the 'spam' file
> There must something i forgot.
> Could anyone help me, please ?

Are you expecting SpamAssassin to read in the file "spam", then write the
output back to the same file?  If so, that's not how SpamAssassin works.
Basically you'd want to do something like:

$spamc < spam > spam.out

That will filter the message in the file 'spam' through spamc<->spamd, and the
resulting output will go into the file called spam.out.

-- 
Randomly Generated Tagline:
"Now they show you how detergents take out bloodstains, a pretty violent 
 image there. I think if you've got a T-shirt with a bloodstain all over 
 it, maybe laundry isn't your biggest problem.  Maybe you should get rid
 of the body before you do the wash."         - Jerry Seinfeld

Re: spamc doesn't add headers

Posted by christophe <ch...@free.fr>.
Le lundi 25 Juillet 2005 11:28, Thomas Arend a écrit :
> [...]
> > But the problem is that in kmail(1.7.1) i don't know the name of the
> > command 'spamc < spam > spam_marked_up' will not work.
> > I read kmail documentation, and whatever i do it doesn't get this output.
> > Now it's a kmail problem.
>
> I use "spamassassin -d | spamc" as a filter in kamil. The first part
> deletes al previous maurup an than spamc checks the mail. You ned no
> redirecktion in kmail.
>
>
> Thomas


Thanks a lot, vielen dank, Thomas, you had the right answer to my problem !
Unlike the kmail+spamassassin tutorials teach it on the internet, you don't 
need to put only spamc in the filter action, you have to use "spamassassin -d 
| spamc", as you correctly suggested.
Guten Abend. Good night.


-- 
Christophe

Re: spamc doesn't add headers

Posted by Thomas Arend <ml...@arend-whv.de>.
Am Montag, 25. Juli 2005 10:50 schrieb christophe:
> Le lundi 25 Juillet 2005 01:05, jdow a écrit :
> > christophe, you DO know that "cat spam" merely prints out your raw
> > spam file so it should not have any markup in it.
> > If you want to view a permanent marked up file you need to run:
> > spamc < spam >spam_marked_up
> > Or something like that. Remember that spamc takes stdin, filters, and
> > feeds back out stdout. So "spamc <spam" is not saving anything to the
> > "spam" file.
>
> OK thanks jdow and Theo. I am sorry to be so naive but i thought that
> inserting a line like :
> add_header spam Flag _YESNOCAPS_
> in the /etc/mail/spamassassin/local.cf file would say to spamc to insert
> the proper flag in the spam file.
> Actually this is what i need spamc to do so that kmail (my mail client)
> treats the spam properly. As i read to do so in many tutorials on the
> internet, i put 2 filters :
> - 1st one is applying spamc on every mail < 250kB
> - 2nd one is detecting the presence of X-Spam-Flag: YES in a message
> So i do _need_ spamc to insert this flag in the message.
> But the problem is that in kmail(1.7.1) i don't know the name of the
> command 'spamc < spam > spam_marked_up' will not work.
> I read kmail documentation, and whatever i do it doesn't get this output.
> Now it's a kmail problem.
> Thanks for your help.

I use "spamassassin -d | spamc" as a filter in kamil. The first part deletes 
al previous maurup an than spamc checks the mail. You ned no redirecktion in 
kmail.


Thomas 

-- 
icq:133073900
http://www.t-arend.de

Re: spamc doesn't add headers

Posted by christophe <ch...@free.fr>.
Le lundi 25 Juillet 2005 01:05, jdow a écrit :
> christophe, you DO know that "cat spam" merely prints out your raw
> spam file so it should not have any markup in it.
> If you want to view a permanent marked up file you need to run:
> spamc < spam >spam_marked_up
> Or something like that. Remember that spamc takes stdin, filters, and
> feeds back out stdout. So "spamc <spam" is not saving anything to the
> "spam" file.

OK thanks jdow and Theo. I am sorry to be so naive but i thought that 
inserting a line like :
add_header spam Flag _YESNOCAPS_
in the /etc/mail/spamassassin/local.cf file would say to spamc to insert the 
proper flag in the spam file.
Actually this is what i need spamc to do so that kmail (my mail client) treats 
the spam properly. As i read to do so in many tutorials on the internet, i 
put 2 filters :
- 1st one is applying spamc on every mail < 250kB
- 2nd one is detecting the presence of X-Spam-Flag: YES in a message
So i do _need_ spamc to insert this flag in the message.
But the problem is that in kmail(1.7.1) i don't know the name of the command 
'spamc < spam > spam_marked_up' will not work.
I read kmail documentation, and whatever i do it doesn't get this output.
Now it's a kmail problem.
Thanks for your help.

-- 
Christophe

Re: spamc doesn't add headers

Posted by jdow <jd...@earthlink.net>.
christophe, you DO know that "cat spam" merely prints out your raw
spam file so it should not have any markup in it.

If you want to view a permanent marked up file you need to run:
spamc < spam >spam_marked_up

Or something like that. Remember that spamc takes stdin, filters, and
feeds back out stdout. So "spamc <spam" is not saving anything to the
"spam" file.

{^_^}
----- Original Message ----- 
From: "christophe" <ch...@free.fr>

I spent my last days googling, reading tutorials, man pages and spamassassin
web sites and tried many differents settings for spamassassin (version
3.0.4)
but without success. So i have no other solutions than asking you.

Here is the content of my /etc/mail/spamassassin/local.cf file :
----------------------------------------------
required_hits 5
report_safe 0
add_header spam Flag _YESNOCAPS_
add_header all Status _YESNO_, score=_SCORE_ required=_REQD_ tests=_TESTS_
autolearn=_AUTOLEARN_ version=_VERSION_
add_header all Level _STARS(*)_
add_header all Checker-Version SpamAssassin _VERSION_ (_SUBVERSION_) on
_HOSTNAME_
auto_whitelist_path        /var/spool/spamassassin/auto-whitelist
auto_whitelist_file_mode   0666
dcc_home                   /var/lib/dcc
----------------------------------------------

spamd is running perfectly as a daemon.
I copied a spam mail in the file 'spam'.
And there i meet a _very_ weird paradox.
If i run one of these 2 commands :

$spamassassin < spam
$spamc -E < spam

i get an output with 'X-Spam-Flag: YES', which is what i want to treat the
email with my maler.
But when i run :

$cat spam

No line with 'X-Spam-Flag: YES' appears. Yet, i thought my config file was
well written. because i put this line :

add_header spam Flag _YESNOCAPS_

I don't understand why no header is added in the 'spam' file
There must something i forgot.
Could anyone help me, please ?


--
Christophe