Gnus development mailing list
 help / color / mirror / Atom feed
From: Wes Hardaker <wes@hardakers.net>
Subject: spam/ham autolearn (spamassassin) markings in summary example....
Date: Wed, 17 Dec 2003 10:07:44 -0800	[thread overview]
Message-ID: <sdsmjjs4gf.fsf@wanderer.hardakers.net> (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



             reply	other threads:[~2003-12-17 18:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-17 18:07 Wes Hardaker [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sdsmjjs4gf.fsf@wanderer.hardakers.net \
    --to=wes@hardakers.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).