[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patch] smtpmail plain auth support
From: |
Jose E. Marchesi |
Subject: |
[patch] smtpmail plain auth support |
Date: |
Sat, 30 Jul 2005 16:24:20 +0200 |
I sent the following patch at 16, July. Any interest on applying it?
From: "Jose E. Marchesi" <address@hidden>
Sender: address@hidden
To: address@hidden
Subject: [patch] smtpmail plain auth support
Date: Sat, 16 Jul 2005 03:14:12 +0200
The following patch for lisp/smtpmail.el implements the PLAIN smtp
authentication method.
--- ChangeLog 6 Jul 2005 12:07:32 -0000 1.426
+++ ChangeLog 16 Jul 2005 01:06:58 -0000
@@ -1,3 +1,9 @@
+2005-07-16 Jose E. Marchesi <address@hidden>
+
+ * lisp/mail/smtpmail.el (smtpmail-auth-supported): Added the
+ 'plain auth method
+ (smtpmail-try-auth-methods): added the AUTH PLAIN dialog
+
2005-07-06 Lute Kamstra <address@hidden>
* configure.in: Fix capitalization.
--- smtpmail.el 4 Jul 2005 17:46:22 -0000 1.75
+++ smtpmail.el 16 Jul 2005 01:01:47 -0000
@@ -207,7 +207,7 @@
(defvar smtpmail-queue-index (concat smtpmail-queue-dir
smtpmail-queue-index-file))
-(defconst smtpmail-auth-supported '(cram-md5 login)
+(defconst smtpmail-auth-supported '(cram-md5 login plain)
"List of supported SMTP AUTH mechanisms.")
;;;
@@ -559,6 +559,22 @@
(not (integerp (car ret)))
(>= (car ret) 400))
(throw 'done nil)))
+ ((eq mech 'plain)
+ (smtpmail-send-command process "AUTH PLAIN")
+ (if (or (null (car (setq ret (smtpmail-read-response process))))
+ (not (integerp (car ret)))
+ (not (equal (car ret) 334)))
+ (throw 'done nil))
+ (smtpmail-send-command process (base64-encode-string
+ (concat "\0"
+ (smtpmail-cred-user cred)
+ "\0"
+ (smtpmail-cred-passwd cred))))
+ (if (or (null (car (setq ret (smtpmail-read-response process))))
+ (not (integerp (car ret)))
+ (not (equal (car ret) 235)))
+ (throw 'done nil)))
+
(t
(error "Mechanism %s not implemented" mech)))
;; Remember the password.