emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sendmail.el bug or expected behavior?


From: Rob Browning
Subject: sendmail.el bug or expected behavior?
Date: Tue, 20 Jan 2004 00:14:47 -0600
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Emacs doesn't always check for a non-zero exit status from sendmail,
which can lead to silent mail lossage.  For example:

 emacs21 -q
 [in the *scratch* buffer]
 (setq sendmail-program "/bin/false") C-j
 M-x vm-mail RET
 check that sendmail-program has right value with C-h v
 fill in a short test message
 C-c C-c
 emacs says `Sending...done'
 (no mail has been sent, of course)

Although from reading mail-interactive's description, I wasn't sure if
this behavior was a bug or intentional:

  mail-interactive's value is nil
  Documentation: *Non-nil means when sending a message wait for and
  display errors.  nil means let mailer mail back a message to report
  errors.

If this isn't just expected behavior, then someone suggested this as a
fix:

+++ emacs21-21.3+1/lisp/mail/sendmail.el
@@ -794,7 +794,7 @@
   (require 'mail-utils)
   (let ((errbuf (if mail-interactive
                    (generate-new-buffer " sendmail errors")
-                 0))
+                 t))
        (tembuf (generate-new-buffer " sendmail temp"))
        (case-fold-search nil)
        (coding (and (local-variable-p 'buffer-file-coding-system)
@@ -972,7 +972,7 @@
                     (args 
                      (append (list (point-min) (point-max)
                                    program
-                                   nil errbuf nil "-oi")
+                                   (not mail-interactive) errbuf nil "-oi")
                              (and mail-specify-envelope-from
                                   (list "-f" (or mail-envelope-from
                                                  user-mail-address)))

but I wasn't sure that this would be OK since it looks like it would
briefly insert, and then remove the sendmail error output from the
current buffer whenever mail-interactive is nil.

(Thanks to Ian Jackson for the example, and Matt Kraai for the
suggested fix.)

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]