Otherwise, answers to all your messages would end up in the
``outgoing'' group.
+If @code{nnmail-debug-splitting} is non-@code{nil}, the mail splitting
+code will log all splitting decisions to the @samp{*nnmail split*} buffer.
+
@node Group Mail Splitting
@subsection Group Mail Splitting
:group 'nnmail
:type 'boolean)
+(defcustom nnmail-debug-splitting nil
+ "If non-nil, record mail splitting actions.
+These will be logged to the \"*nnmail split*\" buffer."
+ :type 'boolean
+ :version "27.1")
+
;;; Internal variables.
(defvar nnmail-article-buffer " *nnmail incoming*"
;; A group name. Do the \& and \N subs into the string.
((stringp split)
- (when nnmail-split-tracing
- (push split nnmail-split-trace))
+ (nnmail-log-split split)
(list (nnmail-expand-newtext split t)))
;; Junk the message.
((eq split 'junk)
- (when nnmail-split-tracing
- (push "junk" nnmail-split-trace))
+ (nnmail-log-split "junk")
(list 'junk))
;; Builtin & operation.
;; Builtin : operation.
((eq (car split) ':)
- (when nnmail-split-tracing
- (push split nnmail-split-trace))
+ (nnmail-log-split split)
(nnmail-split-it (save-excursion (eval (cdr split)))))
;; Builtin ! operation.
(while (and (goto-char end-point)
(re-search-backward (cdr cached-pair) nil t))
(setq match-data (match-data))
- (when nnmail-split-tracing
- (push split nnmail-split-trace))
+ (nnmail-log-split split)
(let ((split-rest (cddr split))
(end (match-end 0))
;; The searched regexp is \(\(FIELD\).*\)\(VALUE\).
(and (nnmail-search-unix-mail-delim-backward)
(not (search-forward "\n\n" pos t))))))
+(defun nnmail-log-split (split)
+ (when nnmail-split-tracing
+ (push split nnmail-split-trace))
+ (when nnmail-debug-splitting
+ (with-current-buffer (get-buffer-create "*nnmail split*")
+ (goto-char (point-max))
+ (insert (format-time-string "%FT%T")
+ " "
+ (format "%S" split)
+ "\n"))))
+
(run-hooks 'nnmail-load-hook)
(provide 'nnmail)