comparison lisp/gnus/nnmail.el @ 26:441bb1e64a06 r19-15b96

Import from CVS: tag r19-15b96
author cvs
date Mon, 13 Aug 2007 08:51:32 +0200
parents 4103f0995bd7
children 1917ad0d78d7
comparison
equal deleted inserted replaced
25:383a494979f8 26:441bb1e64a06
705 (replace-match "X-From-Line: ") ) 705 (replace-match "X-From-Line: ") )
706 (run-hooks 'nnmail-prepare-incoming-header-hook) 706 (run-hooks 'nnmail-prepare-incoming-header-hook)
707 (goto-char (point-max)) 707 (goto-char (point-max))
708 ;; Find the Message-ID header. 708 ;; Find the Message-ID header.
709 (save-excursion 709 (save-excursion
710 (if (re-search-backward "^Message-ID:[ \t]*\\(<[^>]*>\\)" nil t) 710 (if (re-search-backward
711 "^Message-ID[ \t]*:[ \n\t]*\\(<[^>]*>\\)" nil t)
711 (setq message-id (buffer-substring (match-beginning 1) 712 (setq message-id (buffer-substring (match-beginning 1)
712 (match-end 1))) 713 (match-end 1)))
713 ;; There is no Message-ID here, so we create one. 714 ;; There is no Message-ID here, so we create one.
714 (save-excursion 715 (save-excursion
715 (when (re-search-backward "^Message-ID:" nil t) 716 (when (re-search-backward "^Message-ID[ \t]*:" nil t)
716 (beginning-of-line) 717 (beginning-of-line)
717 (insert "Original-"))) 718 (insert "Original-")))
718 (forward-line -1) 719 (forward-line -1)
719 (insert "Message-ID: " (setq message-id (nnmail-message-id)) 720 (insert "Message-ID: " (setq message-id (nnmail-message-id))
720 "\n"))) 721 "\n")))
779 (= (following-char) ?\n))) 780 (= (following-char) ?\n)))
780 (save-excursion 781 (save-excursion
781 (forward-line 1) 782 (forward-line 1)
782 (while (looking-at ">From ") 783 (while (looking-at ">From ")
783 (forward-line 1)) 784 (forward-line 1))
784 (looking-at "[^ \t:]+[ \t]*:"))) 785 (looking-at "[^ \n\t:]+[ \n\t]*:")))
785 (setq found 'yes))))) 786 (setq found 'yes)))))
786 (beginning-of-line) 787 (beginning-of-line)
787 (eq found 'yes))) 788 (eq found 'yes)))
788 789
789 (defun nnmail-search-unix-mail-delim-backward () 790 (defun nnmail-search-unix-mail-delim-backward ()
808 (= (following-char) ?\n))) 809 (= (following-char) ?\n)))
809 (save-excursion 810 (save-excursion
810 (forward-line 1) 811 (forward-line 1)
811 (while (looking-at ">From ") 812 (while (looking-at ">From ")
812 (forward-line 1)) 813 (forward-line 1))
813 (looking-at "[^ \t:]+[ \t]*:"))) 814 (looking-at "[^ \n\t:]+[ \n\t]*:")))
814 (setq found 'yes))))) 815 (setq found 'yes)))))
815 (beginning-of-line) 816 (beginning-of-line)
816 (eq found 'yes))) 817 (eq found 'yes)))
817 818
818 (defun nnmail-process-unix-mail-format (func artnum-func) 819 (defun nnmail-process-unix-mail-format (func artnum-func)
838 (not (eobp))) 839 (not (eobp)))
839 (forward-line 1) 840 (forward-line 1)
840 (point)))) 841 (point))))
841 ;; Find the Message-ID header. 842 ;; Find the Message-ID header.
842 (goto-char (point-min)) 843 (goto-char (point-min))
843 (if (re-search-forward "^Message-ID:[ \t]*\\(<[^>]+>\\)" nil t) 844 (if (re-search-forward "^Message-ID[ \t]*:[ \n\t]*\\(<[^>]+>\\)" nil t)
844 (setq message-id (match-string 1)) 845 (setq message-id (match-string 1))
845 (save-excursion 846 (save-excursion
846 (when (re-search-forward "^Message-ID:" nil t) 847 (when (re-search-forward "^Message-ID[ \t]*:" nil t)
847 (beginning-of-line) 848 (beginning-of-line)
848 (insert "Original-"))) 849 (insert "Original-")))
849 ;; There is no Message-ID here, so we create one. 850 ;; There is no Message-ID here, so we create one.
850 (forward-line 1) 851 (forward-line 1)
851 (insert "Message-ID: " (setq message-id (nnmail-message-id)) "\n")) 852 (insert "Message-ID: " (setq message-id (nnmail-message-id)) "\n"))
922 (not (eobp))) 923 (not (eobp)))
923 (forward-line 1) 924 (forward-line 1)
924 (point)))) 925 (point))))
925 ;; Find the Message-ID header. 926 ;; Find the Message-ID header.
926 (goto-char (point-min)) 927 (goto-char (point-min))
927 (if (re-search-forward "^Message-ID:[ \t]*\\(<[^>]+>\\)" nil t) 928 (if (re-search-forward "^Message-ID[ \t]*:[ \n\t]*\\(<[^>]+>\\)" nil t)
928 (setq message-id (match-string 1)) 929 (setq message-id (match-string 1))
929 ;; There is no Message-ID here, so we create one. 930 ;; There is no Message-ID here, so we create one.
930 (save-excursion 931 (save-excursion
931 (when (re-search-backward "^Message-ID:" nil t) 932 (when (re-search-backward "^Message-ID[ \t]*:" nil t)
932 (beginning-of-line) 933 (beginning-of-line)
933 (insert "Original-"))) 934 (insert "Original-")))
934 (forward-line 1) 935 (forward-line 1)
935 (insert "Message-ID: " (setq message-id (nnmail-message-id)) "\n")) 936 (insert "Message-ID: " (setq message-id (nnmail-message-id)) "\n"))
936 (run-hooks 'nnmail-prepare-incoming-header-hook) 937 (run-hooks 'nnmail-prepare-incoming-header-hook)
1441 ((eq action 'warn) 1442 ((eq action 'warn)
1442 ;; We insert a warning. 1443 ;; We insert a warning.
1443 (let ((case-fold-search t) 1444 (let ((case-fold-search t)
1444 (newid (nnmail-message-id))) 1445 (newid (nnmail-message-id)))
1445 (goto-char (point-min)) 1446 (goto-char (point-min))
1446 (when (re-search-forward "^message-id:" nil t) 1447 (when (re-search-forward "^message-id[ \t]*:" nil t)
1447 (beginning-of-line) 1448 (beginning-of-line)
1448 (insert "Original-")) 1449 (insert "Original-"))
1449 (beginning-of-line) 1450 (beginning-of-line)
1450 (insert 1451 (insert
1451 "Message-ID: " newid "\n" 1452 "Message-ID: " newid "\n"
1579 (defun nnmail-check-syntax () 1580 (defun nnmail-check-syntax ()
1580 "Check (and modify) the syntax of the message in the current buffer." 1581 "Check (and modify) the syntax of the message in the current buffer."
1581 (save-restriction 1582 (save-restriction
1582 (message-narrow-to-head) 1583 (message-narrow-to-head)
1583 (let ((case-fold-search t)) 1584 (let ((case-fold-search t))
1584 (unless (re-search-forward "^Message-ID:" nil t) 1585 (unless (re-search-forward "^Message-ID[ \t]*:" nil t)
1585 (insert "Message-ID: " (nnmail-message-id) "\n"))))) 1586 (insert "Message-ID: " (nnmail-message-id) "\n")))))
1586 1587
1587 (defun nnmail-write-region (start end filename &optional append visit lockname) 1588 (defun nnmail-write-region (start end filename &optional append visit lockname)
1588 "Do a `write-region', and then set the file modes." 1589 "Do a `write-region', and then set the file modes."
1589 (write-region start end filename append visit lockname) 1590 (write-region start end filename append visit lockname)