changeset 53807:61abf9ce6838

(smtpmail-try-auth-methods): Pass port-name as defaultport to `netrc-machine'. Do not try authentication when no mechanism is available.
author Sam Steingold <sds@gnu.org>
date Wed, 04 Feb 2004 15:35:11 +0000
parents e9d57f5fd5bb
children aa6be081315b
files lisp/ChangeLog lisp/mail/smtpmail.el
diffstat 2 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Feb 04 13:45:38 2004 +0000
+++ b/lisp/ChangeLog	Wed Feb 04 15:35:11 2004 +0000
@@ -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
--- a/lisp/mail/smtpmail.el	Wed Feb 04 13:45:38 2004 +0000
+++ b/lisp/mail/smtpmail.el	Wed Feb 04 15:35:11 2004 +0000
@@ -488,15 +488,15 @@
 	 (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 @@
 				(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))