Gnus development mailing list
 help / color / mirror / Atom feed
* spam/ham autolearn (spamassassin) markings in summary example....
@ 2003-12-17 18:07 Wes Hardaker
  2003-12-18  6:57 ` spam/ham autolearn (spamassassin) markings in summary Xavier Maillard
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Wes Hardaker @ 2003-12-17 18:07 UTC (permalink / raw)



So, I just wanted to get spamassain working properly and to ensure
that all the articles it "autolearned" as spam/ham truly were.  The
problem is that you have to open the article to find out.  Well, I've
now done this:

; read in the spam status header
(setq gnus-extra-headers '(To X-Spam-Status)
      nnmail-extra-headers '(To X-Spam-Status))

; for this spam example, the %uS at the end is the important part.
(setq gnus-summary-line-format "%uW%d%U%R%ub%5i %I%(%[ %-15,15n%]%2t%) %-40s %uS\n")

;; mark messages with spam/ham/no autolearned in the summary buffer
;; (at the end of the line, based on the above)
(defun gnus-user-format-function-S (header)
  (let ((head (gnus-extra-header 'X-Spam-Status header)))
    (if (string-match "autolearn=\\(ham\\|spam\\|no\\)" head)
	(substring head (match-beginning 1) (match-end 1))
      "")
    ))

;; color code the first 5 characters (for me == the date) based on the
;; type of mail.  spam = orange, ham = a barely different green/blue
;; than my normal background, no (needs training!) = yellow.
;;    NOTE: this requires my gnus-highlight, which is not yet a part
;;    of the real guns package
(setq gnus-summary-highlight-expressions
 '(
  ;; ... my other stuff deleted
	("^\\(......\\).*no$"                         . ((bg . "yellow")))
	("^\\(......\\).*ham$"                        . ((bg . "#90d0c0")))
	("^\\(......\\).*spam$"                       . ((bg . "orange")))
  ;; ...
  ))


-- 
"In the bathtub of history the truth is harder to hold than the soap,
 and much more difficult to find."  -- Terry Pratchett



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: spam/ham autolearn (spamassassin) markings in summary
  2003-12-17 18:07 spam/ham autolearn (spamassassin) markings in summary example Wes Hardaker
@ 2003-12-18  6:57 ` Xavier Maillard
  2003-12-23 18:13   ` Ted Zlatanov
  2003-12-18 16:41 ` Ted Zlatanov
  2003-12-18 16:55 ` Jeremy Maitin-Shepard
  2 siblings, 1 reply; 7+ messages in thread
From: Xavier Maillard @ 2003-12-18  6:57 UTC (permalink / raw)


<#secure method=pgpmime mode=sign>
Wes Hardaker <wes@hardakers.net> disait récemment que :

> So, I just wanted to get spamassain working properly and to ensure
> that all the articles it "autolearned" as spam/ham truly were.  The
> problem is that you have to open the article to find out.  Well, I've

[...]

Why not integrating this into spam.el directly ? AFAIK, spamassassin is
probably one of the most important spam backend missing IMO. It would
be cool if you can add this in terms of a spam.el processor. Dunno how
difficult it would be to write it though (spam.el is quite obscure to
me).

Btw, I really love your colored spam/ham display stuff :) 

zeDek
-- 
"sometimes i feel like we're making emacs better and better because we
don't know what to do with emacs once it is finished."

    -- AlexSchroeder on #emacs @OPN




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: spam/ham autolearn (spamassassin) markings in summary
  2003-12-17 18:07 spam/ham autolearn (spamassassin) markings in summary example Wes Hardaker
  2003-12-18  6:57 ` spam/ham autolearn (spamassassin) markings in summary Xavier Maillard
@ 2003-12-18 16:41 ` Ted Zlatanov
  2003-12-19 18:04   ` Wes Hardaker
  2003-12-18 16:55 ` Jeremy Maitin-Shepard
  2 siblings, 1 reply; 7+ messages in thread
From: Ted Zlatanov @ 2003-12-18 16:41 UTC (permalink / raw)
  Cc: ding

On Wed, 17 Dec 2003, wes@hardakers.net wrote:

> So, I just wanted to get spamassain working properly and to ensure
> that all the articles it "autolearned" as spam/ham truly were.  The
> problem is that you have to open the article to find out.  Well,
> I've now done this [...]

Cool.  I'll probably do something similar for the next release of
Gnus, as a real formatting specifier instead of a user format
function.  It will probably be two or three letter, one to indicate
the status and the rest to indicate the backend(s) used to detect
that it is spam/ham.

X-Spam-Status is not a reliably way to detect spamicity,
unfortunately.  Blacklists or blackholes, for instance, don't leave a
trace inside the message.  It's better to use the gnus-registry
tracking, which will automatically note when a message is tagged as
spam or ham, by spam/ham processing or incoming/autodetection mail
spam-splitting.  See the latest spam.el, I track the spam/ham
detection history of a message when I do autodetection in
spam-find-spam and spam-split for instance.

Ted



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: spam/ham autolearn (spamassassin) markings in summary
  2003-12-17 18:07 spam/ham autolearn (spamassassin) markings in summary example Wes Hardaker
  2003-12-18  6:57 ` spam/ham autolearn (spamassassin) markings in summary Xavier Maillard
  2003-12-18 16:41 ` Ted Zlatanov
@ 2003-12-18 16:55 ` Jeremy Maitin-Shepard
  2 siblings, 0 replies; 7+ messages in thread
From: Jeremy Maitin-Shepard @ 2003-12-18 16:55 UTC (permalink / raw)


Wes Hardaker <wes@hardakers.net> writes:

> So, I just wanted to get spamassain working properly and to ensure
> that all the articles it "autolearned" as spam/ham truly were.

[snip]

My approach is to filter (using procmail) spam into a separate (Gnus)
group.  Then I ensure that mail is sorted into the correct group by
moving it as appropriate from within Gnus.  Finally, I have a cron job
run every other day, which invokes sa-learn on my various spam and ham
nnml group directories.  The effect is that mail is properly learned.

-- 
Jeremy Maitin-Shepard



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: spam/ham autolearn (spamassassin) markings in summary
  2003-12-18 16:41 ` Ted Zlatanov
@ 2003-12-19 18:04   ` Wes Hardaker
  2003-12-23 18:17     ` Ted Zlatanov
  0 siblings, 1 reply; 7+ messages in thread
From: Wes Hardaker @ 2003-12-19 18:04 UTC (permalink / raw)


>>>>> On Thu, 18 Dec 2003 11:41:29 -0500, Ted Zlatanov <tzz@lifelogs.com> said:

Ted> Cool.  I'll probably do something similar for the next release of
Ted> Gnus, as a real formatting specifier instead of a user format
Ted> function.  It will probably be two or three letter, one to
Ted> indicate the status and the rest to indicate the backend(s) used
Ted> to detect that it is spam/ham.

I know there is already a format spec that marks spam with $ I think, right?

Ted> X-Spam-Status is not a reliably way to detect spamicity,
Ted> unfortunately.  Blacklists or blackholes, for instance, don't
Ted> leave a trace inside the message.  It's better to use the
Ted> gnus-registry tracking, which will automatically note when a
Ted> message is tagged as spam or ham, by spam/ham processing or
Ted> incoming/autodetection mail spam-splitting.  See the latest
Ted> spam.el, I track the spam/ham detection history of a message when
Ted> I do autodetection in spam-find-spam and spam-split for instance.

I apply spamassassin during processing of incoming mail.  I also don't
split inside gnus, and split directly into imap folders via procmail
(that way when I occasionally have to use other mail readers, I don't
have 3000 messages in my inbox because only gnus knows how to split
it).

In short, the example is a bit tailored to my environment (which is
why I said it was an "example" and didn't submit a patch ;-)
-- 
"In the bathtub of history the truth is harder to hold than the soap,
 and much more difficult to find."  -- Terry Pratchett



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: spam/ham autolearn (spamassassin) markings in summary
  2003-12-18  6:57 ` spam/ham autolearn (spamassassin) markings in summary Xavier Maillard
@ 2003-12-23 18:13   ` Ted Zlatanov
  0 siblings, 0 replies; 7+ messages in thread
From: Ted Zlatanov @ 2003-12-23 18:13 UTC (permalink / raw)


On Thu, 18 Dec 2003, zedek@gnu-rox.org wrote:

> Why not integrating this into spam.el directly ? AFAIK, spamassassin
> is probably one of the most important spam backend missing IMO. It
> would be cool if you can add this in terms of a spam.el
> processor. 

There's a SA patch that will be merged sometime after the new year -
it's not written by me, and the author needed to fix a few minor
things. 

> Dunno how difficult it would be to write it though (spam.el is quite
> obscure to me).

I'll make sure to update the "black box" example to show how to write
a new backend for spam.el.

Ted



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: spam/ham autolearn (spamassassin) markings in summary
  2003-12-19 18:04   ` Wes Hardaker
@ 2003-12-23 18:17     ` Ted Zlatanov
  0 siblings, 0 replies; 7+ messages in thread
From: Ted Zlatanov @ 2003-12-23 18:17 UTC (permalink / raw)
  Cc: ding

On Fri, 19 Dec 2003, wes@hardakers.net wrote:

>>>>>> On Thu, 18 Dec 2003 11:41:29 -0500, Ted Zlatanov
>>>>>> <tzz@lifelogs.com> said:
> 
> Ted> Cool.  I'll probably do something similar for the next release
> Ted> of Gnus, as a real formatting specifier instead of a user
> Ted> format function.  It will probably be two or three letter, one
> Ted> to indicate the status and the rest to indicate the backend(s)
> Ted> used to detect that it is spam/ham.
> 
> I know there is already a format spec that marks spam with $ I
> think, right?

Yes, but it doesn't say how the spam came to be detected as spam.  I
think $ will stay as the spam-mark but people will be able to find
out why exactly the spam came about with some extra formatting.

Ted




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-12-23 18:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-17 18:07 spam/ham autolearn (spamassassin) markings in summary example Wes Hardaker
2003-12-18  6:57 ` spam/ham autolearn (spamassassin) markings in summary Xavier Maillard
2003-12-23 18:13   ` Ted Zlatanov
2003-12-18 16:41 ` Ted Zlatanov
2003-12-19 18:04   ` Wes Hardaker
2003-12-23 18:17     ` Ted Zlatanov
2003-12-18 16:55 ` Jeremy Maitin-Shepard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).