aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/mail/sendmail.el24
1 files changed, 21 insertions, 3 deletions
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 3244d1cd103..29f86ff7b08 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -382,6 +382,7 @@ the user from the mailer."
382 0)) 382 0))
383 (tembuf (generate-new-buffer " sendmail temp")) 383 (tembuf (generate-new-buffer " sendmail temp"))
384 (case-fold-search nil) 384 (case-fold-search nil)
385 resend-to-addresses
385 delimline 386 delimline
386 (mailbuf (current-buffer))) 387 (mailbuf (current-buffer)))
387 (unwind-protect 388 (unwind-protect
@@ -413,6 +414,17 @@ the user from the mailer."
413 (goto-char (point-min)) 414 (goto-char (point-min))
414 (if (re-search-forward "^FCC:" delimline t) 415 (if (re-search-forward "^FCC:" delimline t)
415 (mail-do-fcc delimline)) 416 (mail-do-fcc delimline))
417 (goto-char (point-min))
418 (require 'mail-utils)
419 (while (re-search-forward "^Resent-to:" delimline t)
420 (setq resend-to-addresses
421 (save-restriction
422 (narrow-to-region (point)
423 (save-excursion
424 (end-of-line)
425 (point)))
426 (append (mail-parse-comma-list)
427 resend-to-addresses))))
416;;; Apparently this causes a duplicate Sender. 428;;; Apparently this causes a duplicate Sender.
417;;; ;; If the From is different than current user, insert Sender. 429;;; ;; If the From is different than current user, insert Sender.
418;;; (goto-char (point-min)) 430;;; (goto-char (point-min))
@@ -450,8 +462,7 @@ the user from the mailer."
450 (if (boundp 'sendmail-program) 462 (if (boundp 'sendmail-program)
451 sendmail-program 463 sendmail-program
452 "/usr/lib/sendmail") 464 "/usr/lib/sendmail")
453 nil errbuf nil 465 nil errbuf nil "-oi")
454 "-oi" "-t")
455 ;; Always specify who from, 466 ;; Always specify who from,
456 ;; since some systems have broken sendmails. 467 ;; since some systems have broken sendmails.
457 (list "-f" (user-login-name)) 468 (list "-f" (user-login-name))
@@ -462,7 +473,14 @@ the user from the mailer."
462 (list (concat "-oA" mail-alias-file))) 473 (list (concat "-oA" mail-alias-file)))
463 ;; These mean "report errors by mail" 474 ;; These mean "report errors by mail"
464 ;; and "deliver in background". 475 ;; and "deliver in background".
465 (if (null mail-interactive) '("-oem" "-odb")))) 476 (if (null mail-interactive) '("-oem" "-odb"))
477 ;; Get the addresses from the message
478 ;; unless this is a resend.
479 ;; We must not do that for a resend
480 ;; because we would find the original addresses.
481 ;; For a resend, include the specific addresses.
482 (or resend-to-addresses
483 '("-t"))))
466 (if mail-interactive 484 (if mail-interactive
467 (save-excursion 485 (save-excursion
468 (set-buffer errbuf) 486 (set-buffer errbuf)