From bd3bd77b2a71f6fc81daef54bffbc8d66935f8a3 Mon Sep 17 00:00:00 2001 From: okada Date: Wed, 16 Jan 2002 21:15:06 +0000 Subject: [PATCH] * wl-draft.el (wl-smtp-password-key): New function. (wl-smtp-extension-bind): Use `wl-smtp-password-key' (wl-draft-send-mail-with-smtp): Ditto. (wl-draft-send-mail-with-pop-before-smtp): Fix. --- wl/ChangeLog | 7 +++++++ wl/wl-draft.el | 53 ++++++++++++++++++++++++++++++++++------------------- 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index 1ffd7e9..7ad433f 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,10 @@ +2002-01-17 Kenichi OKADA + + * wl-draft.el (wl-smtp-password-key): New function. + (wl-smtp-extension-bind): Use `wl-smtp-password-key' + (wl-draft-send-mail-with-smtp): Ditto. + (wl-draft-send-mail-with-pop-before-smtp): Fix. + 2002-01-12 Kenichi OKADA * wl-vars.el (wl-unique-id-suffix): Move from `wl-utils.el' diff --git a/wl/wl-draft.el b/wl/wl-draft.el index d96e959..a6dfc9b 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -102,6 +102,10 @@ (make-variable-buffer-local 'wl-draft-reply-buffer) (make-variable-buffer-local 'wl-draft-parent-folder) +(defsubst wl-smtp-password-key (user mechnism server) + (format "SMTP:%s/%s@%s" + user mechnism server)) + (defmacro wl-smtp-extension-bind (&rest body) (` (let* ((smtp-sasl-mechanisms (if wl-smtp-authenticate-type @@ -125,9 +129,10 @@ (function (lambda (prompt) (elmo-get-passwd - (format "%s@%s" - smtp-sasl-user-name - smtp-server))))) + (wl-smtp-password-key + smtp-sasl-user-name + (car smtp-sasl-mechanisms) + smtp-server))))) (,@ body)))) (defun wl-draft-insert-date-field () @@ -995,6 +1000,12 @@ non-nil." (error (wl-draft-write-sendlog 'failed 'smtp smtp-server recipients id) + (if (/= (nth 1 err) 334) + (elmo-remove-passwd + (wl-smtp-password-key + smtp-sasl-user-name + (car smtp-sasl-mechanisms) + smtp-server))) (signal (car err) (cdr err))))) (wl-draft-set-sent-message 'mail 'sent) (wl-draft-write-sendlog @@ -1005,22 +1016,26 @@ non-nil." (defun wl-draft-send-mail-with-pop-before-smtp () "Send the prepared message buffer with POP-before-SMTP." (require 'elmo-pop3) - (condition-case () - (let ((session (elmo-pop3-get-session - (luna-make-entity - 'elmo-pop3-folder - :user (or wl-pop-before-smtp-user - elmo-pop3-default-user) - :server (or wl-pop-before-smtp-server - elmo-pop3-default-server) - :port (or wl-pop-before-smtp-port - elmo-pop3-default-port) - :auth (or wl-pop-before-smtp-authenticate-type - elmo-pop3-default-authenticate-type) - :stream-type (or wl-pop-before-smtp-stream-type - elmo-pop3-default-stream-type))))) - (when session (elmo-network-close-session session))) - (error)) + (let ((session + (luna-make-entity + 'elmo-pop3-folder + :user (or wl-pop-before-smtp-user + elmo-pop3-default-user) + :server (or wl-pop-before-smtp-server + elmo-pop3-default-server) + :port (or wl-pop-before-smtp-port + elmo-pop3-default-port) + :auth (or wl-pop-before-smtp-authenticate-type + elmo-pop3-default-authenticate-type) + :stream-type (or wl-pop-before-smtp-stream-type + elmo-pop3-default-stream-type)))) + (condition-case error + (progn + (elmo-pop3-get-session session) + (when session (elmo-network-close-session session))) + (error + (elmo-network-close-session session) + (signal (car error)(cdr error))))) (wl-draft-send-mail-with-smtp)) (defun wl-draft-insert-required-fields (&optional force-msgid) -- 1.7.10.4