Gnus development mailing list
 help / color / mirror / Atom feed
* Splitting on body and pattern tracing
@ 2002-09-06 19:32 Svend Tollak Munkejord
  0 siblings, 0 replies; only message in thread
From: Svend Tollak Munkejord @ 2002-09-06 19:32 UTC (permalink / raw)


Dear all,

I am subscribed to a a certain mailing list where the spam percentage is
somewhat irritating, so I would like to filter away the spam. My idea is to
deem as spam those messages which do not contain terms relevant to the
mailing list.

The Gnus manual ((gnus)Fancy Mail Splitting) contains the example function
split-on-body. However, it is unfortunate that if one tries to trace the
fancy splitting patterns using this function, Gnus reacts with an error
message, because there is no " *nnmail incoming*" buffer. I glanced a bit
at the examples of ((gnus)SpamAssassin), and tried the following:

(defun split-on-body-list ()
  (save-excursion
    (let ((buf (or (get-buffer " *nnmail incoming*"); for e-mail
		   (get-buffer " *nnfolder move*"); for respool (B r)
		   (get-buffer " *Original Article*")))); for trace (B t)
      (if (not buf)
	  (progn (message "Oops, cannot find message buffer") nil)
	(set-buffer buf)
	(goto-char (point-min))
	(when (not (re-search-forward "regexp-with-relevant-terms" nil t));
	  "spam")))))

(setq nnmail-split-fancy
       '(|
...
	 (any          "some@list"
		  (| (: split-on-body-list) "list.group"));
...
	 ))

There is one more problem: The function gnus-summary-respool-query in
gnus-sum.el says (message-narrow-to-head). To me, it seemed that this
prevented split-on-body-list from operating on the body of the message. I
just commented it out, and then the split-on-body-list seemed to do its
job.

Why is the (message-narrow-to-head) there? Could my commenting it out have
adverse effects? Comments or suggestions, anyone?

I am not a Gnus/lisp programmer, so I might be a bit off the track...

-- 
Svend Tollak Munkejord 



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-09-06 19:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-06 19:32 Splitting on body and pattern tracing Svend Tollak Munkejord

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