(defvar nnmail-split-history nil
"List of group/article elements that say where the previous split put messages.")
+(defvar nnmail-current-spool nil)
+
(defvar nnmail-pop-password nil
"*Password to use when reading mail from a POP server, if required.")
(mail-send-and-exit nil))
;; 1997/5/4 by MORIOKA Tomohiko <morioka@jaist.ac.jp>
-(defvar nnmail-file-coding-system nil
+(defvar nnmail-file-coding-system 'raw-text
"Coding system used in nnmail.")
(defun nnmail-find-file (file)
"Make pathname for GROUP."
(concat
(let ((dir (file-name-as-directory (expand-file-name dir))))
+ (setq group (nnheader-translate-file-chars group))
;; If this directory exists, we use it directly.
(if (or nnmail-use-long-file-names
(file-directory-p (concat dir group)))
(save-excursion
(setq errors (generate-new-buffer " *nnmail loss*"))
(buffer-disable-undo errors)
- (let ((default-directory "/"))
- (if (nnheader-functionp nnmail-movemail-program)
- (condition-case err
- (progn
- (funcall nnmail-movemail-program inbox tofile)
- (setq result 0))
- (error
- (save-excursion
- (set-buffer errors)
- (insert (prin1-to-string err))
- (setq result 255))))
+ (if (nnheader-functionp nnmail-movemail-program)
+ (condition-case err
+ (progn
+ (funcall nnmail-movemail-program inbox tofile)
+ (setq result 0))
+ (error
+ (save-excursion
+ (set-buffer errors)
+ (insert (prin1-to-string err))
+ (setq result 255))))
+ (let ((default-directory "/"))
(setq result
(apply
'call-process
(if (not (and (re-search-forward "^From " nil t)
(goto-char (match-beginning 0))))
;; Possibly wrong format?
- (error "Error, unknown mail format! (Possibly corrupted.)")
+ (progn
+ (pop-to-buffer (find-file-noselect nnmail-current-spool))
+ (error "Error, unknown mail format! (Possibly corrupted.)"))
;; Carry on until the bitter end.
(while (not (eobp))
(setq start (point)
(if (not (and (re-search-forward delim nil t)
(forward-line 1)))
;; Possibly wrong format?
- (error "Error, unknown mail format! (Possibly corrupted.)")
+ (progn
+ (pop-to-buffer (find-file-noselect nnmail-current-spool))
+ (error "Error, unknown mail format! (Possibly corrupted.)"))
;; Carry on until the bitter end.
(while (not (eobp))
(setq start (point))
;;; Utility functions
-;; Written by byer@mv.us.adobe.com (Scott Byer).
(defun nnmail-make-complex-temp-name (prefix)
(let ((newname (make-temp-name prefix))
(newprefix prefix))
;; Builtin : operation.
((eq (car split) ':)
- (nnmail-split-it (eval (cdr split))))
+ (nnmail-split-it (save-excursion (eval (cdr split)))))
;; Check the cache for the regexp for this split.
;; FIX FIX FIX could avoid calling assq twice here
nnmail-use-procmail)
(directory-files
nnmail-procmail-directory
- t (concat (if group (concat "^" group) "")
+ t (concat (if group (concat "^" (regexp-quote group)) "")
nnmail-procmail-suffix "$"))))
(p procmails)
(crash (when (and (file-exists-p nnmail-crash-box)
(setq nnmail-split-history nil))
(let* ((spools (nnmail-get-spool-files group))
(group-in group)
- incoming incomings spool)
+ nnmail-current-spool incoming incomings spool)
(when (and (nnmail-get-value "%s-get-new-mail" method)
nnmail-spool-file)
;; We first activate all the groups.
(nnheader-message 3 "%s: Reading incoming mail..." method)
(when (and (nnmail-move-inbox spool)
(file-exists-p nnmail-crash-box))
+ (setq nnmail-current-spool spool)
;; There is new mail. We first find out if all this mail
;; is supposed to go to some specific group.
(setq group (nnmail-get-split-group spool group-in))