X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fmail-source.el;h=19fdf51f30f08f4dc2854acd338e9dd1f417a81b;hb=d05ec456b0be733280da2616519bc58ee282b20a;hp=f7f2fc09de62b857f4384c449840cd4ce8049f6d;hpb=47d9fb83899ad78af540bb6db32e663ace30841b;p=gnus diff --git a/lisp/mail-source.el b/lisp/mail-source.el index f7f2fc09d..19fdf51f3 100644 --- a/lisp/mail-source.el +++ b/lisp/mail-source.el @@ -966,14 +966,13 @@ This only works when `display-time' is enabled." (defun mail-source-fetch-imap (source callback) "Fetcher for imap sources." (mail-source-bind (imap source) - (let* ((from (format "%s:%s:%s" server user port)) - (found 0) - (buffer-name " *imap source*") - (buf (get-buffer-create (generate-new-buffer-name buffer-name))) - (mail-source-string (format "imap:%s:%s" server mailbox)) - (imap-shell-program (or (list program) imap-shell-program)) - remove) - (if (and (imap-open server port stream authentication buffer-name) + (let ((from (format "%s:%s:%s" server user port)) + (found 0) + (buf (generate-new-buffer " *imap source*")) + (mail-source-string (format "imap:%s:%s" server mailbox)) + (imap-shell-program (or (list program) imap-shell-program)) + remove) + (if (and (imap-open server port stream authentication buf) (imap-authenticate user (or (cdr (assoc from mail-source-password-cache)) password) buf) @@ -1006,6 +1005,7 @@ This only works when `display-time' is enabled." (nnheader-ms-strip-cr)) (incf found (mail-source-callback callback server)) (when (and remove fetchflag) + (setq remove (nreverse remove)) (imap-message-flags-add (imap-range-to-message-set (gnus-compress-sequence remove)) fetchflag nil buf))