+2000-07-19 Kim-Minh Kaplan <kmkaplan@galaxy.fr>
+
+ * imap.el (imap-calculate-literal-size-first): New variable.
+ (imap-local-variables): Add it.
+ (imap-kerberos4-open): Set it.
+ (imap-send-command): Use it.
+
2000-07-17 14:18:16 ShengHuo ZHU <zsh@cs.rochester.edu>
* mailcap.el (mailcap-mimetypes-parsed-p): New variable.
imap-failed-tags
imap-tag
imap-process
+ imap-calculate-literal-size-first
imap-mailbox-data))
;; Internal variables.
(defvar imap-port nil)
(defvar imap-username nil)
(defvar imap-password nil)
+(defvar imap-calculate-literal-size-first nil)
(defvar imap-state 'closed
"IMAP state.
Valid states are `closed', `initial', `nonauth', `auth', `selected'
response)
(when process
(with-current-buffer buffer
- (setq imap-client-eol "\n")
+ (setq imap-client-eol "\n"
+ imap-calculate-literal-size-first t)
(while (and (memq (process-status process) '(open run))
(goto-char (point-min))
;; cyrus 1.6.x (13? < x <= 22) queries capabilities
(cond ((stringp cmd)
(setq cmdstr (concat cmdstr cmd)))
((bufferp cmd)
- (setq cmdstr
- (concat cmdstr (format "{%d}" (with-current-buffer cmd
- (buffer-size)))))
+ (let ((eol imap-client-eol)
+ (calcfirst imap-calculate-literal-size-first)
+ size)
+ (with-current-buffer cmd
+ (if calcfirst
+ (setq size (buffer-size)))
+ (when (not (equal eol "\r\n"))
+ ;; XXX modifies buffer!
+ (goto-char (point-min))
+ (while (search-forward "\r\n" nil t)
+ (replace-match eol)))
+ (if (not calcfirst)
+ (setq size (buffer-size))))
+ (setq cmdstr
+ (concat cmdstr (format "{%d}" size))))
(unwind-protect
(progn
(imap-send-command-1 cmdstr)
(stream imap-stream)
(eol imap-client-eol))
(with-current-buffer cmd
- (when (not (equal eol "\r\n"))
- ;; XXX modifies buffer!
- (goto-char (point-min))
- (while (search-forward "\r\n" nil t)
- (replace-match eol)))
(and imap-log
(with-current-buffer (get-buffer-create
imap-log)