Gnus development mailing list
 help / color / mirror / Atom feed
* Fallback for nnmail-split-methods
@ 2002-04-20  9:19 Thomas Gehrlein
  2002-05-08 11:36 ` Kai Großjohann
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Gehrlein @ 2002-04-20  9:19 UTC (permalink / raw)


nnmail-split-fancy has a fallback option for mails that don't match any of the
splitting rules.  nnmail-split-methods doesnt't provide a fallback.  I
discovered this after some of my mails had disappeared.

Here's some code that makes nnmail-split-methods safer.  I'm not really happy
with my approach, but I couldn't figure out how the gnus splitting code works.

(defun nnmail-split-methods-add-fall-back ()
  "Add a fall-back group to nnmail-split-methods if there isn't one."
  ;; check for fall-back: second element of last list of split methods is "".
  (unless (or (eq nnmail-split-methods 'nnmail-split-fancy)
              (string= ""
                       (cadr (elt nnmail-split-methods
                                  (1- (length nnmail-split-methods))))))
    ;; add fall-back if there isn't one
    (setq nnmail-split-methods
          (append nnmail-split-methods (list (list "mail.misc" ""))))))

(add-hook 'nnmail-prepare-incoming-hook 'nnmail-split-methods-add-fall-back)

Thomas




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-05-11 21:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-20  9:19 Fallback for nnmail-split-methods Thomas Gehrlein
2002-05-08 11:36 ` Kai Großjohann
2002-05-10 14:44   ` Frank Haun
2002-05-11 18:00     ` Kai Großjohann
2002-05-11 18:55   ` Paul Jarc
2002-05-11 21:01     ` Kai Großjohann

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