aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-04-20 18:03:00 +0000
committerRichard M. Stallman1998-04-20 18:03:00 +0000
commit5feeeae29d2f59c9e33e65030b1f62ffd8c243bc (patch)
tree7c04bc6beeb40fc95f8d77ac4cf09d7ded96b45e
parent969fe9b5696c9d9d31f2faf1ca2e8af107013dcb (diff)
downloademacs-5feeeae29d2f59c9e33e65030b1f62ffd8c243bc.tar.gz
emacs-5feeeae29d2f59c9e33e65030b1f62ffd8c243bc.zip
(smtpmail-send-it): Deleted all code related to Resent-To: processing.
(smtpmail-deduce-address-list): Changed the search for Resent-\(To\|Cc\|Bcc\) headers. (smtpmail-do-bcc): Delete Resent-Bcc: headers.
-rw-r--r--lisp/mail/smtpmail.el51
1 files changed, 15 insertions, 36 deletions
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index a3310b79528..95b512a65b3 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -117,7 +117,6 @@ This is relative to `smtpmail-queue-dir'.")
117 0)) 117 0))
118 (tembuf (generate-new-buffer " smtpmail temp")) 118 (tembuf (generate-new-buffer " smtpmail temp"))
119 (case-fold-search nil) 119 (case-fold-search nil)
120 resend-to-addresses
121 delimline 120 delimline
122 (mailbuf (current-buffer))) 121 (mailbuf (current-buffer)))
123 (unwind-protect 122 (unwind-protect
@@ -145,36 +144,17 @@ This is relative to `smtpmail-queue-dir'.")
145 (< (point) delimline)) 144 (< (point) delimline))
146 (replace-match "\n")) 145 (replace-match "\n"))
147 (let ((case-fold-search t)) 146 (let ((case-fold-search t))
148 (goto-char (point-min)) 147 ;; We used to process Resent-... headers here,
149 (goto-char (point-min)) 148 ;; but it was not done properly, and the job
150 (while (re-search-forward "^Resent-to:" delimline t) 149 ;; is done correctly in smtpmail-deduce-address-list.
151 (setq resend-to-addresses
152 (save-restriction
153 (narrow-to-region (point)
154 (save-excursion
155 (end-of-line)
156 (point)))
157 (append (mail-parse-comma-list)
158 resend-to-addresses))))
159;;; Apparently this causes a duplicate Sender.
160;;; ;; If the From is different than current user, insert Sender.
161;;; (goto-char (point-min))
162;;; (and (re-search-forward "^From:" delimline t)
163;;; (progn
164;;; (require 'mail-utils)
165;;; (not (string-equal
166;;; (mail-strip-quoted-names
167;;; (save-restriction
168;;; (narrow-to-region (point-min) delimline)
169;;; (mail-fetch-field "From")))
170;;; (user-login-name))))
171;;; (progn
172;;; (forward-line 1)
173;;; (insert "Sender: " (user-login-name) "\n")))
174 ;; Don't send out a blank subject line 150 ;; Don't send out a blank subject line
175 (goto-char (point-min)) 151 (goto-char (point-min))
176 (if (re-search-forward "^Subject:[ \t]*\n" delimline t) 152 (if (re-search-forward "^Subject:\\([ \t]*\n\\)+\\b" delimline t)
177 (replace-match "")) 153 (replace-match "")
154 ;; This one matches a Subject just before the header delimiter.
155 (if (and (re-search-forward "^Subject:\\([ \t]*\n\\)+" delimline t)
156 (= (match-end 0) delimline))
157 (replace-match "")))
178 ;; Put the "From:" field in unless for some odd reason 158 ;; Put the "From:" field in unless for some odd reason
179 ;; they put one in themselves. 159 ;; they put one in themselves.
180 (goto-char (point-min)) 160 (goto-char (point-min))
@@ -239,8 +219,7 @@ This is relative to `smtpmail-queue-dir'.")
239 ;; 219 ;;
240 (setq smtpmail-address-buffer (generate-new-buffer "*smtp-mail*")) 220 (setq smtpmail-address-buffer (generate-new-buffer "*smtp-mail*"))
241 (setq smtpmail-recipient-address-list 221 (setq smtpmail-recipient-address-list
242 (or resend-to-addresses 222 (smtpmail-deduce-address-list tembuf (point-min) delimline))
243 (smtpmail-deduce-address-list tembuf (point-min) delimline)))
244 (kill-buffer smtpmail-address-buffer) 223 (kill-buffer smtpmail-address-buffer)
245 224
246 (smtpmail-do-bcc delimline) 225 (smtpmail-do-bcc delimline)
@@ -644,9 +623,9 @@ This is relative to `smtpmail-queue-dir'.")
644 (goto-char (point-min)) 623 (goto-char (point-min))
645 ;; RESENT-* fields should stop processing of regular fields. 624 ;; RESENT-* fields should stop processing of regular fields.
646 (save-excursion 625 (save-excursion
647 (if (re-search-forward "^RESENT-TO:" header-end t) 626 (if (re-search-forward "^Resent-\\(to\\|cc\\|bcc\\):" header-end t)
648 (setq addr-regexp "^\\(RESENT-TO:\\|RESENT-CC:\\|RESENT-BCC:\\)") 627 (setq addr-regexp "^Resent-\\(to\\|cc\\|bcc\\):")
649 (setq addr-regexp "^\\(TO:\\|CC:\\|BCC:\\)"))) 628 (setq addr-regexp "^\\(To:\\|Cc:\\|Bcc:\\)")))
650 629
651 (while (re-search-forward addr-regexp header-end t) 630 (while (re-search-forward addr-regexp header-end t)
652 (replace-match "") 631 (replace-match "")
@@ -688,13 +667,13 @@ This is relative to `smtpmail-queue-dir'.")
688 667
689 668
690(defun smtpmail-do-bcc (header-end) 669(defun smtpmail-do-bcc (header-end)
691 "Delete BCC: and their continuation lines from the header area. 670 "Delete [Resent-]BCC: and their continuation lines from the header area.
692There may be multiple BCC: lines, and each may have arbitrarily 671There may be multiple BCC: lines, and each may have arbitrarily
693many continuation lines." 672many continuation lines."
694 (let ((case-fold-search t)) 673 (let ((case-fold-search t))
695 (save-excursion (goto-char (point-min)) 674 (save-excursion (goto-char (point-min))
696 ;; iterate over all BCC: lines 675 ;; iterate over all BCC: lines
697 (while (re-search-forward "^BCC:" header-end t) 676 (while (re-search-forward "^\(RESENT-\)?BCC:" header-end t)
698 (delete-region (match-beginning 0) (progn (forward-line 1) (point))) 677 (delete-region (match-beginning 0) (progn (forward-line 1) (point)))
699 ;; get rid of any continuation lines 678 ;; get rid of any continuation lines
700 (while (and (looking-at "^[ \t].*\n") (< (point) header-end)) 679 (while (and (looking-at "^[ \t].*\n") (< (point) header-end))