From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Jose E. Marchesi" Newsgroups: gmane.emacs.devel Subject: [patch] smtpmail plain auth support Date: Sat, 30 Jul 2005 16:24:20 +0200 Message-ID: <17131.36244.51165.649012@gargle.gargle.HOWL> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1122733883 10930 80.91.229.2 (30 Jul 2005 14:31:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 30 Jul 2005 14:31:23 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 30 16:31:20 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DysMZ-00040L-8K for ged-emacs-devel@m.gmane.org; Sat, 30 Jul 2005 16:30:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DysP7-0004cu-FP for ged-emacs-devel@m.gmane.org; Sat, 30 Jul 2005 10:33:33 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DysMg-00040t-4f for emacs-devel@gnu.org; Sat, 30 Jul 2005 10:31:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DysMb-0003yo-0h for emacs-devel@gnu.org; Sat, 30 Jul 2005 10:30:57 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DysMa-0003qB-DZ for emacs-devel@gnu.org; Sat, 30 Jul 2005 10:30:56 -0400 Original-Received: from [85.48.67.25] (helo=termi.gnu.org) by monty-python.gnu.org with asmtp (Exim 4.34) id 1DysLp-0003mW-4u for emacs-devel@gnu.org; Sat, 30 Jul 2005 10:30:09 -0400 Original-To: emacs-devel@gnu.org X-Mailer: VM 7.18 under Emacs 22.0.50.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:41347 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:41347 I sent the following patch at 16, July. Any interest on applying it? From: "Jose E. Marchesi" 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 + + * 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 * 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.