unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [patch] smtpmail plain auth support
@ 2005-07-16  1:14 Jose E. Marchesi
  0 siblings, 0 replies; 2+ messages in thread
From: Jose E. Marchesi @ 2005-07-16  1:14 UTC (permalink / raw)



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  <jemarch@gnu.org>
+
+	* 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  <lute@gnu.org>
 
 	* 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread
* [patch] smtpmail plain auth support
@ 2005-07-30 14:24 Jose E. Marchesi
  0 siblings, 0 replies; 2+ messages in thread
From: Jose E. Marchesi @ 2005-07-30 14:24 UTC (permalink / raw)



I sent the following patch at 16, July. Any interest on applying it?


From: "Jose E. Marchesi" <jemarch@gnu.org>
Sender: emacs-devel-bounces+jemarch=es.gnu.org@gnu.org
To: emacs-devel@gnu.org
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  <jemarch@gnu.org>
+
+	* 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  <lute@gnu.org>
 
 	* 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-07-30 14:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-16  1:14 [patch] smtpmail plain auth support Jose E. Marchesi
  -- strict thread matches above, loose matches on Subject: below --
2005-07-30 14:24 Jose E. Marchesi

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).