# HG changeset patch # User Richard M. Stallman # Date 850723597 0 # Node ID 0ecab43a0f69288abf36a0f24aa5feae0196a52b # Parent 9cfa629723bfa62d78ba41961fef6bf90dcb7245 (sendmail-send-it): If no recipients, don't run the mailer program. If there was also no fcc file, signal error. diff -r 9cfa629723bf -r 0ecab43a0f69 lisp/mail/sendmail.el --- a/lisp/mail/sendmail.el Mon Dec 16 07:51:24 1996 +0000 +++ b/lisp/mail/sendmail.el Mon Dec 16 08:06:37 1996 +0000 @@ -559,6 +559,7 @@ (case-fold-search nil) resend-to-addresses delimline + fcc-was-found (mailbuf (current-buffer))) (unwind-protect (save-excursion @@ -677,36 +678,45 @@ ;; Find and handle any FCC fields. (goto-char (point-min)) (if (re-search-forward "^FCC:" delimline t) - (mail-do-fcc delimline)) + (progn + (setq fcc-was-found t) + (mail-do-fcc delimline))) (if mail-interactive (save-excursion (set-buffer errbuf) (erase-buffer)))) - (let ((default-directory "/")) - (apply 'call-process-region - (append (list (point-min) (point-max) - (if (boundp 'sendmail-program) - sendmail-program - "/usr/lib/sendmail") - nil errbuf nil "-oi") - ;; Always specify who from, - ;; since some systems have broken sendmails. - (list "-f" (user-login-name)) -;;; ;; Don't say "from root" if running under su. -;;; (and (equal (user-real-login-name) "root") -;;; (list "-f" (user-login-name))) - (and mail-alias-file - (list (concat "-oA" mail-alias-file))) - ;; These mean "report errors by mail" - ;; and "deliver in background". - (if (null mail-interactive) '("-oem" "-odb")) - ;; Get the addresses from the message - ;; unless this is a resend. - ;; We must not do that for a resend - ;; because we would find the original addresses. - ;; For a resend, include the specific addresses. - (or resend-to-addresses - '("-t"))))) + (goto-char (point-min)) + (if (let ((case-fold-search t)) + (re-search-forward "^To:\\|^cc:\\|^bcc:\\|^resent-to:\ +\\|^resent-cc:\\|^resent-bcc:" + delimline t) + (let ((default-directory "/")) + (apply 'call-process-region + (append (list (point-min) (point-max) + (if (boundp 'sendmail-program) + sendmail-program + "/usr/lib/sendmail") + nil errbuf nil "-oi") + ;; Always specify who from, + ;; since some systems have broken sendmails. + (list "-f" (user-login-name)) + ;;; ;; Don't say "from root" if running under su. + ;;; (and (equal (user-real-login-name) "root") + ;;; (list "-f" (user-login-name))) + (and mail-alias-file + (list (concat "-oA" mail-alias-file))) + ;; These mean "report errors by mail" + ;; and "deliver in background". + (if (null mail-interactive) '("-oem" "-odb")) + ;; Get the addresses from the message + ;; unless this is a resend. + ;; We must not do that for a resend + ;; because we would find the original addresses. + ;; For a resend, include the specific addresses. + (or resend-to-addresses + '("-t"))))) + (or fcc-was-found + (error "No recipients"))) (if mail-interactive (save-excursion (set-buffer errbuf)