From d6a85b98709d366d06a97799a731459c401e796d Mon Sep 17 00:00:00 2001 From: okada Date: Wed, 1 Dec 1999 14:21:09 +0000 Subject: [PATCH] Upteda. sasl-mech anonymous --- ChangeLog | 14 +++++++++----- smtp.el | 37 +++++++++++++++++++++++++++++-------- 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index debba6f..cbc97b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,14 @@ 1999-12-01 Kenichi OKADA - * SLIM-VERSION: Fix. + * smtp.el (smtp-auth-anonymous): New function. + (smtp-authentication-method-alist): Add anonymous. + +1999-12-01 Kenichi OKADA + + * SLIM-VERSION: Fix. * smtp.el: Fix Author. * sasl.el (sasl-cram-md5): Update to delete - insecure sequences at plain. + insecure sequences. 1999-11-28 Kenichi OKADA @@ -68,9 +73,8 @@ 1999-10-23 Kenichi OKADA * smtp.el (smtp-auth-cram-md5): Update to delete - insecure sequences at plain. - (smtp-auth-login): Update to delete - insecure sequences at plain. + insecure sequences. + (smtp-auth-login): Ditto. 1999-11-23 Kenichi OKADA diff --git a/smtp.el b/smtp.el index 77f43ad..6b6162a 100644 --- a/smtp.el +++ b/smtp.el @@ -99,6 +99,7 @@ don't define this value." '((cram-md5 smtp-auth-cram-md5) (plain smtp-auth-plain) (login smtp-auth-login) + (anonymous smtp-auth-anonymous) )) (defcustom smtp-connection-type nil @@ -503,14 +504,14 @@ don't define this value." (smtp-send-command process (setq secure-word (unwind-protect - (sasl-plain "" smtp-authentication-user secure-word) - (fillarray secure-word 0)) + (sasl-plain "" smtp-authentication-user secure-word) + (fillarray secure-word 0)) secure-word (unwind-protect - (base64-encode-string secure-word) - (fillarray secure-word 0)) + (base64-encode-string secure-word) + (fillarray secure-word 0)) secure-word (unwind-protect - (concat "AUTH PLAIN " secure-word) - (fillarray secure-word 0)))) + (concat "AUTH PLAIN " secure-word) + (fillarray secure-word 0)))) (fillarray secure-word 0) (setq response (smtp-read-response process)) (if (or (null (car response)) @@ -532,14 +533,34 @@ don't define this value." (smtp-send-command process (setq secure-word (unwind-protect - (base64-encode-string secure-word) - (fillarray secure-word 0)))) + (base64-encode-string secure-word) + (fillarray secure-word 0)))) (fillarray secure-word 0) (setq response (smtp-read-response process)) (if (or (null (car response)) (not (integerp (car response))) (>= (car response) 400)) (throw 'done (car (cdr response)))))) + +(defun smtp-auth-anonymous (process &optional token) + (let (response) + (smtp-send-command + process "AUTH ANONYMOUS") + (setq response (smtp-read-response process)) + (if (or (null (car response)) + (not (integerp (car response))) + (>= (car response) 400)) + (throw 'done (car (cdr response)))) + (smtp-send-command process + (base64-encode-string + (or token + user-mail-address + ""))) + (setq response (smtp-read-response process)) + (if (or (null (car response)) + (not (integerp (car response))) + (>= (car response) 400)) + (throw 'done (car (cdr response)))))) (provide 'smtp) -- 1.7.10.4