From: Lars Magne Ingebrigtsen Date: Mon, 17 Apr 2006 16:04:54 +0000 (+0000) Subject: (imap-quote-specials): New function. X-Git-Url: http://cgit.sxemacs.org/?a=commitdiff_plain;h=7c5dc1ff98f43a713c1a0739841b339ec2e3083e;p=gnus (imap-quote-specials): New function. (imap-login-auth): Quote specials. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 33c822972..c851d804a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2006-04-17 Lars Magne Ingebrigtsen + * imap.el (imap-quote-specials): New function. + (imap-login-auth): Quote specials. + * rfc2231.el (rfc2231-parse-string): Remove dead code. (rfc2231-parse-string): Allow concatanation of parameters that aren't contiguous. The test case is diff --git a/lisp/imap.el b/lisp/imap.el index 6d489b678..c8772de4d 100644 --- a/lisp/imap.el +++ b/lisp/imap.el @@ -912,14 +912,27 @@ Returns t if login was successful, nil otherwise." (and (not (imap-capability 'LOGINDISABLED buffer)) (not (imap-capability 'X-LOGIN-CMD-DISABLED buffer)))) +(defun imap-quote-specials (string) + (with-temp-buffer + (insert string) + (goto-char (point-min)) + (while (re-search-forward "[\\\"]" nil t) + (forward-char -1) + (insert "\\") + (forward-char 1)) + (buffer-string))) + (defun imap-login-auth (buffer) "Login to server using the LOGIN command." (message "imap: Plaintext authentication...") (imap-interactive-login buffer (lambda (user passwd) (imap-ok-p (imap-send-command-wait - (concat "LOGIN \"" user "\" \"" - passwd "\"")))))) + (concat "LOGIN \"" + (imap-quote-specials user) + "\" \"" + (imap-quote-specials passwd) + "\"")))))) (defun imap-anonymous-p (buffer) t)