From: "Jose E. Marchesi" <jemarch@gnu.org>
Subject: [patch] smtpmail plain auth support
Date: Sat, 16 Jul 2005 03:14:12 +0200 [thread overview]
Message-ID: <17112.24420.840819.476907@gargle.gargle.HOWL> (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.
next reply other threads:[~2005-07-16 1:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-16 1:14 Jose E. Marchesi [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-07-30 14:24 [patch] smtpmail plain auth support Jose E. Marchesi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17112.24420.840819.476907@gargle.gargle.HOWL \
--to=jemarch@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).