(when (eq (car ret) 334)
(let* ((challenge (substring (cadr ret) 4))
(decoded (base64-decode-string challenge))
+ (password (encode-coding-string password 'utf-8))
+ (user (encode-coding-string user 'utf-8))
(hash (rfc2104-hash 'md5 64 16 password decoded))
(response (concat user " " hash))
;; Osamu Yamane <yamane@green.ocn.ne.jp>:
(cl-defmethod smtpmail-try-auth-method
(process (_mech (eql 'login)) user password)
(smtpmail-command-or-throw process "AUTH LOGIN")
- (smtpmail-command-or-throw process (base64-encode-string user t))
- (smtpmail-command-or-throw process (base64-encode-string password t)))
+ (let ((password (encode-coding-string password 'utf-8))
+ (user (encode-coding-string user 'utf-8)))
+ (smtpmail-command-or-throw process (base64-encode-string user t))
+ (smtpmail-command-or-throw process (base64-encode-string password t))))
(cl-defmethod smtpmail-try-auth-method
(process (_mech (eql 'plain)) user password)
;; violate a SHOULD in RFC 2222 paragraph 5.1. Note that this
;; is not sent if the server did not advertise AUTH PLAIN in
;; the EHLO response. See RFC 2554 for more info.
- (smtpmail-command-or-throw
- process
- (concat "AUTH PLAIN "
- (base64-encode-string (concat "\0" user "\0" password) t))
- 235))
+ (let ((password (encode-coding-string password 'utf-8))
+ (user (encode-coding-string user 'utf-8)))
+ (smtpmail-command-or-throw
+ process
+ (concat "AUTH PLAIN "
+ (base64-encode-string (concat "\0" user "\0" password) t))
+ 235)))
(cl-defmethod smtpmail-try-auth-method
(process (_mech (eql 'xoauth2)) user password)