aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-12-16 08:06:37 +0000
committerRichard M. Stallman1996-12-16 08:06:37 +0000
commit00365e9831c50e1ab61584f35ddb42814c8a1ddd (patch)
tree8147a0375bece99c04de4a7ccf734970e11e3406
parentbbcb3f00ac4dce90a4baf6d44a25b4e1f7574bc4 (diff)
downloademacs-00365e9831c50e1ab61584f35ddb42814c8a1ddd.tar.gz
emacs-00365e9831c50e1ab61584f35ddb42814c8a1ddd.zip
(sendmail-send-it): If no recipients, don't run
the mailer program. If there was also no fcc file, signal error.
-rw-r--r--lisp/mail/sendmail.el62
1 files changed, 36 insertions, 26 deletions
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 27273995bd6..9ad63d69737 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -559,6 +559,7 @@ the user from the mailer."
559 (case-fold-search nil) 559 (case-fold-search nil)
560 resend-to-addresses 560 resend-to-addresses
561 delimline 561 delimline
562 fcc-was-found
562 (mailbuf (current-buffer))) 563 (mailbuf (current-buffer)))
563 (unwind-protect 564 (unwind-protect
564 (save-excursion 565 (save-excursion
@@ -677,36 +678,45 @@ the user from the mailer."
677 ;; Find and handle any FCC fields. 678 ;; Find and handle any FCC fields.
678 (goto-char (point-min)) 679 (goto-char (point-min))
679 (if (re-search-forward "^FCC:" delimline t) 680 (if (re-search-forward "^FCC:" delimline t)
680 (mail-do-fcc delimline)) 681 (progn
682 (setq fcc-was-found t)
683 (mail-do-fcc delimline)))
681 (if mail-interactive 684 (if mail-interactive
682 (save-excursion 685 (save-excursion
683 (set-buffer errbuf) 686 (set-buffer errbuf)
684 (erase-buffer)))) 687 (erase-buffer))))
685 (let ((default-directory "/")) 688 (goto-char (point-min))
686 (apply 'call-process-region 689 (if (let ((case-fold-search t))
687 (append (list (point-min) (point-max) 690 (re-search-forward "^To:\\|^cc:\\|^bcc:\\|^resent-to:\
688 (if (boundp 'sendmail-program) 691\\|^resent-cc:\\|^resent-bcc:"
689 sendmail-program 692 delimline t)
690 "/usr/lib/sendmail") 693 (let ((default-directory "/"))
691 nil errbuf nil "-oi") 694 (apply 'call-process-region
692 ;; Always specify who from, 695 (append (list (point-min) (point-max)
693 ;; since some systems have broken sendmails. 696 (if (boundp 'sendmail-program)
694 (list "-f" (user-login-name)) 697 sendmail-program
695;;; ;; Don't say "from root" if running under su. 698 "/usr/lib/sendmail")
696;;; (and (equal (user-real-login-name) "root") 699 nil errbuf nil "-oi")
697;;; (list "-f" (user-login-name))) 700 ;; Always specify who from,
698 (and mail-alias-file 701 ;; since some systems have broken sendmails.
699 (list (concat "-oA" mail-alias-file))) 702 (list "-f" (user-login-name))
700 ;; These mean "report errors by mail" 703 ;;; ;; Don't say "from root" if running under su.
701 ;; and "deliver in background". 704 ;;; (and (equal (user-real-login-name) "root")
702 (if (null mail-interactive) '("-oem" "-odb")) 705 ;;; (list "-f" (user-login-name)))
703 ;; Get the addresses from the message 706 (and mail-alias-file
704 ;; unless this is a resend. 707 (list (concat "-oA" mail-alias-file)))
705 ;; We must not do that for a resend 708 ;; These mean "report errors by mail"
706 ;; because we would find the original addresses. 709 ;; and "deliver in background".
707 ;; For a resend, include the specific addresses. 710 (if (null mail-interactive) '("-oem" "-odb"))
708 (or resend-to-addresses 711 ;; Get the addresses from the message
709 '("-t"))))) 712 ;; unless this is a resend.
713 ;; We must not do that for a resend
714 ;; because we would find the original addresses.
715 ;; For a resend, include the specific addresses.
716 (or resend-to-addresses
717 '("-t")))))
718 (or fcc-was-found
719 (error "No recipients")))
710 (if mail-interactive 720 (if mail-interactive
711 (save-excursion 721 (save-excursion
712 (set-buffer errbuf) 722 (set-buffer errbuf)