[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Success, except for splitting




Hi,

I've been using nnimap-0.3.13 successfully for a week or so now.
My configuration is:

		XEmacs 20.4
		Gnus 5.6.24
		Lotus Notes Domino 4.6.1

It has taken me a while to configure splitting correctly.  I have 
the following in my .gnus:

(setq nnimap-split-inbox "INBOX")
(setq nnimap-split-crosspost nil)
(setq nnimap-split-rule
	  '(("ClearCase" "^Subject:.*\\[cciug\\]")
		("DDTS" "^From:.*ddts")
		("nnimap" "^\\(To\\|Cc\\):.*gnus-imap")
		))

I encountered the following problems:

1. With nnimap-split-crosspost switched on, it would only split to
the first rule if non-nil.  The code seems to give up as soon as
it sees a nil.  If the second rule matched then the first item in 
the list returned from nnimap-split-to-groups would be nil and
the while loop would exit immediately.

2. With nnimap-split-crosspost switched off, it would work fine
unless none of the rules matched.  If no rules matched then
nnimap-split-articles would infinite-loop in the "until" bit.  
I could fix this by adding a null rule to the end, forcing me to
move everything out of my INBOX.  This is assuming that I cannot
define a split rule which leaves things in the INBOX.

3. nnimap-split-articles appears to be processing every
nnimap-split-inbox for each nnimap group I am subscribed to.
This is because nnimap-split-articles is called for every
subscribed group.


I'm not to bright with lisp coding at the moment, but I managed
to hack nnimap-split-articles to solve problems 2 and 3 above.

(defun nnimap-split-articles (&optional group server)
  (when (nnimap-possibly-change-server server)
    (with-current-buffer nnimap-server-buffer
      (let (inbox (inboxes (if (atom nnimap-split-inbox)
			       (list nnimap-split-inbox)
			     nnimap-split-inbox)))
	;; iterate over inboxes
	(while (and (setq inbox (pop inboxes))

			;;
			;; Only continue if this group is one of the
            ;; nnimap-split-inboxes
            ;;
		    (equal group inbox)

		    (nnimap-possibly-change-group inbox))
	  (let (article (unseens (nnimap-search "UNSEEN")))
	    ;; iterate over articles
	    (while (setq article (pop unseens))
	      (when (nnimap-request-head article)
		;; article into what groups?
		(let ((groups (nnimap-split-to-groups)))
		  ;; move it there
		  (if nnimap-split-crosspost
		      ;; move to all boxes
		      (let (to-group)
			(while (setq to-group (pop groups))
			  (nnimap-split-move-article article inbox to-group)))

		    ;; move to first non-nil box
			;;
			;; Don't use until.  Instead set to-group to the
			;; first non-nil group, then test it before
			;; continuing.
			;;
		    (let (to-group)
		      (while (not (setq to-group (pop groups)))
    			nil)
		      (if to-group
			  (nnimap-split-move-article article inbox to-group)))
		    ))))))))))


With these changes, it's working well.  Excellent work. 

Is EXPUNGE implemented ?  I'd like to try article deletion.  I am 
subscribed to a high volume mailing list so I currently have to
use a different IMAP client to periodically clean up that IMAP
folder. 

Cheers.
-- 
Donald Hunter