X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fnnmail.el;h=fa886516ef147e60c1ec1c016dce2f912280e4f6;hb=9bff3e1ed66aee0c93773573fc662b10c4b72a1b;hp=5304d32f7406b18774065b586af03fca1c5fe0a6;hpb=2e75b797f85b5a60325d65039a47fb93eac04021;p=gnus diff --git a/lisp/nnmail.el b/lisp/nnmail.el index 5304d32f7..fa886516e 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -507,8 +507,8 @@ nn*-request-list should have been called before calling this function." If SOURCE is a directory spec, try to return the group name component." (if (eq (car source) 'directory) (let ((file (file-name-nondirectory file))) - (mail-source-bind directory source - (if (string-match (concat (regexp-quote suffix "$") file)) + (mail-source-bind (directory source) + (if (string-match (concat (regexp-quote suffix) "$") file) (substring file 0 (match-beginning 0)) nil))) nil)) @@ -1000,6 +1000,15 @@ Return the number of characters in the body." "Translate TAB characters into SPACE characters." (subst-char-in-region (point-min) (point-max) ?\t ? t)) +(defun nnmail-fix-eudora-headers () + "Eudora has a broken References line, but an OK In-Reply-To." + (goto-char (point-min)) + (when (re-search-forward "^X-Mailer:.*Eudora" nil t) + (goto-char (point-min)) + (when (re-search-forward "^References:" nil t) + (beginning-of-line) + (insert "X-Gnus-Broken-Eudora-")))) + ;;; Utility functions (defun nnmail-split-fancy () @@ -1245,6 +1254,13 @@ See the documentation for the variable `nnmail-split-fancy' for documentation." (t nnmail-treat-duplicates)))) group-art) + ;; We insert a line that says what the mail source is. + (let ((case-fold-search t)) + (goto-char (point-min)) + (re-search-forward "^message-id[ \t]*:" nil t) + (beginning-of-line) + (insert (format "X-Gnus-Mail-Source: %s\n" mail-source-string))) + ;; Let the backend save the article (or not). (cond ((not duplication) @@ -1307,7 +1323,8 @@ See the documentation for the variable `nnmail-split-fancy' for documentation." (list 'directory :path source)) (t (list 'file :path source))))) - (nnheader-message 3 "%s: Reading incoming mail %S..." method source) + (nnheader-message 4 "%s: Reading incoming mail from %s..." + method (car source)) (when (mail-source-fetch source `(lambda (file orig-file) @@ -1324,7 +1341,7 @@ See the documentation for the variable `nnmail-split-fancy' for documentation." (when exit-func (funcall exit-func)) (run-hooks 'nnmail-read-incoming-hook) - (nnheader-message 3 "%s: Reading incoming mail...done" method)) + (nnheader-message 4 "%s: Reading incoming mail...done" method)) ;; Close the message-id cache. (nnmail-cache-close) ;; Allow the user to hook. @@ -1351,9 +1368,7 @@ See the documentation for the variable `nnmail-split-fancy' for documentation." ((numberp days) (setq days (days-to-time days)) ;; Compare the time with the current time. - (condition-case () - (time-less-p days (time-since time)) - (error nil))))))) + (ignore-errors (time-less-p days (time-since time)))))))) (defun nnmail-check-syntax () "Check (and modify) the syntax of the message in the current buffer."