emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r107283: smtpmail initial prompting f


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107283: smtpmail initial prompting fixes
Date: Tue, 14 Feb 2012 16:43:07 +0100
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107283
committer: Lars Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Tue 2012-02-14 16:43:07 +0100
message:
  smtpmail initial prompting fixes
  
  (smtpmail-query-smtp-server): Prompt the user for a port number if
  we can't connect to any of the standard ports.
modified:
  lisp/ChangeLog
  lisp/mail/smtpmail.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-02-14 15:31:49 +0000
+++ b/lisp/ChangeLog    2012-02-14 15:43:07 +0000
@@ -2,6 +2,8 @@
 
        * mail/smtpmail.el (smtpmail-query-smtp-server): Fix typo in the
        way the ports list is computed.
+       (smtpmail-query-smtp-server): Prompt the user for a port number if
+       we can't connect to any of the standard ports (bug#10810).
 
 2012-02-14  Teodor Zlatanov  <address@hidden>
 

=== modified file 'lisp/mail/smtpmail.el'
--- a/lisp/mail/smtpmail.el     2012-02-14 15:31:49 +0000
+++ b/lisp/mail/smtpmail.el     2012-02-14 15:43:07 +0000
@@ -598,16 +598,24 @@
 (defun smtpmail-query-smtp-server ()
   (let ((server (read-string "Outgoing SMTP mail server: "))
        (ports '(25 587))
-       stream port)
+       stream port prompted)
     (when (and smtpmail-smtp-service
               (not (member smtpmail-smtp-service ports)))
       (push smtpmail-smtp-service ports))
     (while (and (not smtpmail-smtp-server)
                (setq port (pop ports)))
-      (when (setq stream (condition-case ()
-                            (open-network-stream "smtp" nil server port)
-                          (quit nil)
-                          (error nil)))
+      (if (not (setq stream (condition-case ()
+                               (open-network-stream "smtp" nil server port)
+                             (quit nil)
+                             (error nil))))
+         ;; We've used up the list of default ports, so query the
+         ;; user.
+         (when (and (not ports)
+                    (not prompted))
+           (push (read-number (format "Port number to use when contacting %s? "
+                                      server))
+                 ports)
+           (setq prompted t))
        (customize-save-variable 'smtpmail-smtp-server server)
        (customize-save-variable 'smtpmail-smtp-service port)
        (delete-process stream)))


reply via email to

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