(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)
- (buf (get-buffer-create
- (format " *imap source %s:%s:%s *" server user mailbox)))
- (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)
+ (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)
(imap-authenticate
user (or (cdr (assoc from mail-source-password-cache))
password) buf)