all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: hackerb9@member.fsf.org
To: 25874@debbugs.gnu.org
Subject: bug#25874: 24.4; sendmail-query-user-about-smtp allows nil function
Date: Sat, 25 Feb 2017 10:20:42 -0800	[thread overview]
Message-ID: <CAO+cPoOsdQUOEwWfALWejTYCFoQHFzCfXWCd81mNySrP7RRBCw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3424 bytes --]

If you hit Enter at the "Send mail via" prompt, Emacs will misconfigure
itself so it is impossible to send mail.

RECIPE TO REPEAT

1. Start a new mail message using C-x 4 m

2. After composing, hit C-c C-c to send

3. Emacs will prompt "Send mail via: "

   (This is sendmail.el:sendmail-query-user-about-smtp asking how you
   would like to send mail. Valid responses are: "mail client",
   "transport", or "smtp")

4. Hit the Enter key, assuming Emacs will pick a reasonable default

5. Be surprised when you get a mysterious error message:

   "Symbol's function definition is void: nil"

6. Hit C-c C-c to try to send the message again, assuming Emacs will
   again prompt and you can give a different response.

7. Be even more surprised that instead of asking "Send message via" a
   second time, Emacs has memorized that you want to use the function
   "nil" to send messages and will simply give the same error message
   every time.


One simple fix would be to have the function sendmail-query-once check
if the value of send-mail-function is nil. It is not perfect as it
will still show the user the error message (seen in step 5), but at
least the user can try again. Here is a patch which implements that
fix:
----------------------------------------------------------------------

--- sendmail.el.orig	2014-10-21 14:45:42.000000000 -0700
+++ sendmail.el	2017-02-18 05:58:20.085685326 -0800
@@ -507,15 +507,16 @@
 ;;;###autoload
 (defun sendmail-query-once ()
   "Query for `send-mail-function' and send mail with it.
 This also saves the value of `send-mail-function' via Customize."
   ;; If send-mail-function is already setup, we're incorrectly called
   ;; a second time, probably because someone's using an old value
   ;; of send-mail-function.
-  (when (eq send-mail-function 'sendmail-query-once)
+  (when (or (not (fboundp send-mail-function))
+	    (eq send-mail-function 'sendmail-query-once))
     (sendmail-query-user-about-smtp))
   (funcall send-mail-function))

 (defun sendmail-query-user-about-smtp ()
   (let* ((options `(("mail client" . mailclient-send-it)
 		    ,@(when (and sendmail-program
 				 (executable-find sendmail-program))

----------------------------------------------------------------------


In GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5)
 of 2015-03-07 on trouble, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11604000
System Description:	Debian GNU/Linux 8.7 (jessie)

Configured using:
 `configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.4/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.4/site-lisp:/usr/share/emacs/site-lisp
 --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib
 --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.4/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.4/site-lisp:/usr/share/emacs/site-lisp
 --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat
 -Werror=format-security -Wall' CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-z,relro'

[-- Attachment #2: Type: text/html, Size: 3630 bytes --]

             reply	other threads:[~2017-02-25 18:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-25 18:20 hackerb9 [this message]
2017-02-27  3:26 ` bug#25874: 24.4; sendmail-query-user-about-smtp allows nil function npostavs
2017-03-07  4:11   ` npostavs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAO+cPoOsdQUOEwWfALWejTYCFoQHFzCfXWCd81mNySrP7RRBCw@mail.gmail.com \
    --to=hackerb9@member.fsf.org \
    --cc=25874@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.