]> git.eshelyaron.com Git - emacs.git/commitdiff
(smtpmail-try-auth-methods): Pass port-name as defaultport to `netrc-machine'.
authorSam Steingold <sds@gnu.org>
Wed, 4 Feb 2004 15:35:11 +0000 (15:35 +0000)
committerSam Steingold <sds@gnu.org>
Wed, 4 Feb 2004 15:35:11 +0000 (15:35 +0000)
Do not try authentication when no mechanism is available.

lisp/ChangeLog
lisp/mail/smtpmail.el

index bf8051e7c7655f09f0d9f9ac96c87896f5e0faeb..95a92f77e9f67ef807b592642c6059c9ed2a487c 100644 (file)
@@ -1,3 +1,9 @@
+2004-02-04  Sam Steingold  <sds@gnu.org>
+
+       * mail/smtpmail.el (smtpmail-try-auth-methods):
+       Do not try authentication when no mechanism is available.
+       Pass port-name as defaultport to `netrc-machine'.
+
 2004-02-04  Stephen Eglen  <stephen@gnu.org>
 
        * iswitchb.el (iswitchb-minibuffer-setup-hook): Update doc string
index bd9d5d7dd39a94ecac80f8f81bce2d7f5a0233a4..1730d131f60d1ee8b2cbcf1245a504450b49ee2f 100644 (file)
@@ -488,15 +488,15 @@ This is relative to `smtpmail-queue-dir'.")
         (mech (car (smtpmail-intersection smtpmail-auth-supported mechs)))
         (cred (if (stringp smtpmail-auth-credentials)
                   (let* ((netrc (netrc-parse smtpmail-auth-credentials))
-                         (hostentry (netrc-machine
-                                     netrc host (format "%s" (or port "smtp"))
-                                     "smtp")))
+                          (port-name (format "%s" (or port "smtp")))
+                         (hostentry (netrc-machine netrc host port-name
+                                                    port-name)))
                      (when hostentry
                        (list host port
                              (netrc-get hostentry "login")
                              (netrc-get hostentry "password"))))
                 (smtpmail-find-credentials
-                 smtpmail-auth-credentials host port)))
+                 smtpmail-auth-credentiaals host port)))
         (passwd (when cred
                   (or (smtpmail-cred-passwd cred)
                       (read-passwd
@@ -504,7 +504,7 @@ This is relative to `smtpmail-queue-dir'.")
                                (smtpmail-cred-server cred)
                                (smtpmail-cred-port cred))))))
         ret)
-    (when cred
+    (when (and cred mech)
       (cond
        ((eq mech 'cram-md5)
        (smtpmail-send-command process (format "AUTH %s" mech))