From: Glenn Morris Date: Fri, 13 May 2011 02:06:35 +0000 (-0700) Subject: * lisp/mail/feedmail.el (feedmail-buffer-to-sendmail): Require sendmail. X-Git-Url: https://git.hcoop.net/bpt/emacs.git/commitdiff_plain/5237a44fef24911b77fd6e4f55c0e319f9747641?hp=8340026caeee82b1972f40e7a1bd0d83edbaecef * lisp/mail/feedmail.el (feedmail-buffer-to-sendmail): Require sendmail. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ccfc6f6a40..3fa18d2480 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2011-05-13 Glenn Morris + * mail/feedmail.el (feedmail-buffer-to-sendmail): Require sendmail. + * mail/sendmail.el (sendmail-program): Try executable-find first. (sendmail-send-it): sendmail-program cannot be unbound. diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el index 597344fb88..56936e88ef 100644 --- a/lisp/mail/feedmail.el +++ b/lisp/mail/feedmail.el @@ -1312,22 +1312,16 @@ Feeds the buffer to it." (mapconcat 'identity addr-listoid " ")))))) +(defvar sendmail-program) + (defun feedmail-buffer-to-sendmail (prepped errors-to addr-listoid) "Function which actually calls sendmail as a subprocess. Feeds the buffer to it. Probably has some flaws for Resent-* and other complicated cases." + (require 'sendmail) (set-buffer prepped) (apply 'call-process-region - (append (list (point-min) (point-max) - (cond ((boundp 'sendmail-program) - sendmail-program) - ((file-exists-p "/usr/sbin/sendmail") - "/usr/sbin/sendmail") - ((file-exists-p "/usr/lib/sendmail") - "/usr/lib/sendmail") - ((file-exists-p "/usr/ucblib/sendmail") - "/usr/ucblib/sendmail") - (t "fakemail")) + (append (list (point-min) (point-max) sendmail-program nil errors-to nil "-oi" "-t") ;; provide envelope "from" to sendmail; results will vary (list "-f" user-mail-address)