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

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).