* sorting summary on spamassassin score @ 2004-04-07 18:59 Dan Christensen 2004-04-07 19:05 ` Wes Hardaker 2004-04-07 23:33 ` Adam Sjøgren 0 siblings, 2 replies; 11+ messages in thread From: Dan Christensen @ 2004-04-07 18:59 UTC (permalink / raw) Does anyone have code for sorting the summary buffer based on the score given by spamassassin? This score appears in a header, which I guess I would add to gnus-extra-headers. If someone has ready made code, that'd be great. While I'm asking, does anyone have code for extracting the spamassassin score and putting it in the summary line? Thanks, Dan ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: sorting summary on spamassassin score 2004-04-07 18:59 sorting summary on spamassassin score Dan Christensen @ 2004-04-07 19:05 ` Wes Hardaker 2004-04-07 23:33 ` Adam Sjøgren 1 sibling, 0 replies; 11+ messages in thread From: Wes Hardaker @ 2004-04-07 19:05 UTC (permalink / raw) >>>>> On Wed, 07 Apr 2004 14:59:41 -0400, Dan Christensen <jdc@uwo.ca> said: Dan> Does anyone have code for sorting the summary buffer based on the Dan> score given by spamassassin? This score appears in a header, Dan> which I guess I would add to gnus-extra-headers. If someone has Dan> ready made code, that'd be great. Should be doable, but it'd probably be processor intensive. I thought about doing something like that but haven't. Dan> While I'm asking, does anyone have code for extracting the Dan> spamassassin score and putting it in the summary line? No, but I've thought about that too. I do something similar with the X-Spam-Status line, though, that you should be able to adapt: ;; mark messages with X-ping in them (setq gnus-extra-headers '(To X-Spam-Status) (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)) "") )) I put the spam/ham/unknown markings at the end to trigger my summary highlight expressions so that the first 6 characters (the date for me) of the line are highlighted with a particular color if I need to train spamassain on the message. Gives a nice visual queue. You could do something similar with scoring I'm sure. (I also highlight the baysean score in the article buffer with green, but I've wanted to move it to the summary buffer as well but haven't yet). -- "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] 11+ messages in thread
* Re: sorting summary on spamassassin score 2004-04-07 18:59 sorting summary on spamassassin score Dan Christensen 2004-04-07 19:05 ` Wes Hardaker @ 2004-04-07 23:33 ` Adam Sjøgren 2004-04-21 19:22 ` Dan Christensen 1 sibling, 1 reply; 11+ messages in thread From: Adam Sjøgren @ 2004-04-07 23:33 UTC (permalink / raw) On Wed, 07 Apr 2004 14:59:41 -0400, Dan wrote: > Does anyone have code for sorting the summary buffer based on the > score given by spamassassin? This score appears in a header, which I > guess I would add to gnus-extra-headers. If someone has ready made > code, that'd be great. From earlier discussion I've got the following: in the group-parameters for my spam-group, this: ((gnus-show-threads nil) (gnus-extra-headers '(X-Spam-Status To Newsgroups)) (gnus-article-sort-functions '(gnus-article-sort-by-spam-status))) And this in my ~/.gnus: ; Sort by X-Spam-Status: ; (by Michael Shields <shields@msrl.com> in <87brssb9cg.fsf@mulligatwani.msrl.com> ;; Set gnus-extra-headers instead^WALSO: (add-to-list 'nnmail-extra-headers 'X-Spam-Status) (defun gnus-article-sort-by-spam-status (h1 h2) "Sort articles by score from the X-Spam-Status: header." (< (string-to-number (gnus-replace-in-string (gnus-extra-header 'X-Spam-Status h1) ".*hits=" "")) (string-to-number (gnus-replace-in-string (gnus-extra-header 'X-Spam-Status h2) ".*hits=" "")))) You need to rebuild the overview databases for X-Spam-Status to be added for existing articles, I seem to remember. Best regards, Adam -- "We are relaxed but nervous." Adam Sjøgren asjo@koldfront.dk ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: sorting summary on spamassassin score 2004-04-07 23:33 ` Adam Sjøgren @ 2004-04-21 19:22 ` Dan Christensen 2004-04-22 18:30 ` Ted Zlatanov 0 siblings, 1 reply; 11+ messages in thread From: Dan Christensen @ 2004-04-21 19:22 UTC (permalink / raw) Wes and Adam, thanks for the suggestions. Here's what I now use: In the group parameters for my spam group: ((gnus-show-threads nil) (gnus-article-sort-functions '(jdc-gnus-article-sort-by-spam-status))) In my .gnus.el: (add-to-list 'nnmail-extra-headers 'X-Spam-Status) (add-to-list 'gnus-extra-headers 'X-Spam-Status) (defun jdc-spam-status (h) "The spam rating from the X-Spam-Status header." (string-to-number (gnus-replace-in-string (gnus-extra-header 'X-Spam-Status h) ".*hits=" ""))) (defun gnus-user-format-function-s (h) (jdc-spam-status h)) (defun jdc-gnus-article-sort-by-spam-status (h1 h2) "Sort articles by score from the X-Spam-Status: header." (< (jdc-spam-status h1) (jdc-spam-status h2))) And I added "%us" to my gnus-summary-line-format. Dan ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: sorting summary on spamassassin score 2004-04-21 19:22 ` Dan Christensen @ 2004-04-22 18:30 ` Ted Zlatanov 2004-04-23 13:53 ` Dan Christensen 0 siblings, 1 reply; 11+ messages in thread From: Ted Zlatanov @ 2004-04-22 18:30 UTC (permalink / raw) On Wed, 21 Apr 2004, jdc@uwo.ca wrote: > Wes and Adam, thanks for the suggestions. I'm not sure who to thank, but I added the code you have below to spam.el for general use. Right now only SpamAssassin is supported, but it's intended for any backend that can score on a header. If I can get a consensus on who came up with ideas and implementation, I'll put that in the ChangeLog. The main difference is that in my version, any spam headers, not just X-Spam-Status, are supported. So, how does it work? You just use spam-initialize as usual. The only three things users will need to do: 1) (defalias 'gnus-user-format-function-S 'spam-user-format-function-S) if they want to use %uS in the summary line format. I'm considering making this a built-in, e.g. %$ but I'm not sure yet. 2) set spam-use-spamassassin, spam-use-spamassassin-headers, or spam-use-regex-headers BEFORE they run spam-initialize. Conveniently, this can now be done like so: (spam-initialize 'spam-use-spamassassin ...) which will set spam-use-spamassassin to t BEFORE any intialization is done. Very useful, and you don't need (setq spam-use-spamassassin t) before spam-initialize anymore. 3) in the groups of interest, set the group article sorting to use spam-article-sort-by-spam-status, that is, set gnus-article-sort-functions to '(spam-article-sort-by-spam-status). You may need gnus-show-threads set to nil. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: sorting summary on spamassassin score 2004-04-22 18:30 ` Ted Zlatanov @ 2004-04-23 13:53 ` Dan Christensen 2004-04-23 14:05 ` Adam Sjøgren 0 siblings, 1 reply; 11+ messages in thread From: Dan Christensen @ 2004-04-23 13:53 UTC (permalink / raw) Ted Zlatanov <tzz@lifelogs.com> writes: > I'm not sure who to thank, but I added the code you have below to > spam.el for general use. Right now only SpamAssassin is supported, > but it's intended for any backend that can score on a header. If I > can get a consensus on who came up with ideas and implementation, I'll > put that in the ChangeLog. The part involving sorting was Adam; the part involving the summary line was me based on Adam and Wes. I have copyright assignment papers on file. Dan ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: sorting summary on spamassassin score 2004-04-23 13:53 ` Dan Christensen @ 2004-04-23 14:05 ` Adam Sjøgren 2004-04-27 22:41 ` Ted Zlatanov 0 siblings, 1 reply; 11+ messages in thread From: Adam Sjøgren @ 2004-04-23 14:05 UTC (permalink / raw) On Fri, 23 Apr 2004 09:53:41 -0400, Dan wrote: > The part involving sorting was Adam; the part involving the summary > line was me based on Adam and Wes. I have copyright assignment > papers on file. And the parts I was involved in are based on a previous thread, from which I've recorded that I got what I am using from Michael Shields in the posting <87brssb9cg.fsf@mulligatwani.msrl.com> :-), -- "Shout up!" Adam Sjøgren asjo@koldfront.dk ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: sorting summary on spamassassin score 2004-04-23 14:05 ` Adam Sjøgren @ 2004-04-27 22:41 ` Ted Zlatanov 2004-04-27 23:05 ` Wes Hardaker ` (2 more replies) 0 siblings, 3 replies; 11+ messages in thread From: Ted Zlatanov @ 2004-04-27 22:41 UTC (permalink / raw) Cc: ding, Dan Christensen, Wes Hardaker, Michael Shields On Fri, 23 Apr 2004, asjo@koldfront.dk wrote: On Fri, 23 Apr 2004 09:53:41 -0400, Dan wrote: > >> The part involving sorting was Adam; the part involving the summary >> line was me based on Adam and Wes. I have copyright assignment >> papers on file. > > And the parts I was involved in are based on a previous thread, from > which I've recorded that I got what I am using from Michael Shields > in the posting <87brssb9cg.fsf@mulligatwani.msrl.com> OK, so Dan Christensen <jdc@uwo.ca> asjo@koldfront.dk (Adam Sjøgren) Wes Hardaker <wes@hardakers.net> Michael Shields <shields@msrl.com> will get credit for the sorting by X-Spam-Status and related headers in spam.el. Please let me know if copyright assignment will be a problem (I don't think so). Anyone else, speak up or forever hold your peas :) Thanks Ted ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: sorting summary on spamassassin score 2004-04-27 22:41 ` Ted Zlatanov @ 2004-04-27 23:05 ` Wes Hardaker 2004-04-27 23:09 ` Michael Shields 2004-05-20 18:45 ` Ted Zlatanov 2 siblings, 0 replies; 11+ messages in thread From: Wes Hardaker @ 2004-04-27 23:05 UTC (permalink / raw) Cc: ding, Dan Christensen, Michael Shields >>>>> On Tue, 27 Apr 2004 18:41:09 -0400, Ted Zlatanov <tzz@lifelogs.com> said: Ted> Dan Christensen <jdc@uwo.ca> Ted> asjo@koldfront.dk (Adam Sjøgren) Ted> Wes Hardaker <wes@hardakers.net> Ted> Michael Shields <shields@msrl.com> Ted> will get credit for the sorting by X-Spam-Status and related Ted> headers in spam.el. Please let me know if copyright assignment Ted> will be a problem (I don't think so). Anyone else, speak up or Ted> forever hold your peas :) I'm not sure I contributed enough code to warrant a check, but hey... A name in lights is a name in lights. [yes, paperwork is on file though] -- "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] 11+ messages in thread
* Re: sorting summary on spamassassin score 2004-04-27 22:41 ` Ted Zlatanov 2004-04-27 23:05 ` Wes Hardaker @ 2004-04-27 23:09 ` Michael Shields 2004-05-20 18:45 ` Ted Zlatanov 2 siblings, 0 replies; 11+ messages in thread From: Michael Shields @ 2004-04-27 23:09 UTC (permalink / raw) Cc: ding, Dan Christensen, Wes Hardaker In message <4nd65t2ge2.fsf@lifelogs.com>, Ted Zlatanov <tzz@lifelogs.com> wrote: > will get credit for the sorting by X-Spam-Status and related headers > in spam.el. Please let me know if copyright assignment will be a > problem (I don't think so). I have papers on file. -- Shields. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: sorting summary on spamassassin score 2004-04-27 22:41 ` Ted Zlatanov 2004-04-27 23:05 ` Wes Hardaker 2004-04-27 23:09 ` Michael Shields @ 2004-05-20 18:45 ` Ted Zlatanov 2 siblings, 0 replies; 11+ messages in thread From: Ted Zlatanov @ 2004-05-20 18:45 UTC (permalink / raw) Cc: ding, Dan Christensen, Wes Hardaker, Michael Shields On Tue, 27 Apr 2004, tzz@lifelogs.com wrote: > Dan Christensen <jdc@uwo.ca> > asjo@koldfront.dk (Adam Sjøgren) > Wes Hardaker <wes@hardakers.net> > Michael Shields <shields@msrl.com> > > will get credit for the sorting by X-Spam-Status and related headers > in spam.el. Please let me know if copyright assignment will be a > problem (I don't think so). Anyone else, speak up or forever hold > your peas :) I made this change to the ChangeLog. I hope I did it in the correct format - let me know if not. Ted ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2004-05-20 18:45 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2004-04-07 18:59 sorting summary on spamassassin score Dan Christensen 2004-04-07 19:05 ` Wes Hardaker 2004-04-07 23:33 ` Adam Sjøgren 2004-04-21 19:22 ` Dan Christensen 2004-04-22 18:30 ` Ted Zlatanov 2004-04-23 13:53 ` Dan Christensen 2004-04-23 14:05 ` Adam Sjøgren 2004-04-27 22:41 ` Ted Zlatanov 2004-04-27 23:05 ` Wes Hardaker 2004-04-27 23:09 ` Michael Shields 2004-05-20 18:45 ` Ted Zlatanov
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).