(elmo-pop3-get-session): Make msgdb directory after session.
(elmo-folder-exists-p): Check exactly at the first time even when the
elmo-pop3-exists-exactly is nil.
* elmo-pipe.el (elmo-folder-open-internal): Don't drain here.
(elmo-folder-list-messages): Define instead of
elmo-folder-list-messages-internal.
(elmo-folder-check): Check destination folder.
(elmo-folder-synchronize): Drain the pipe.
* elmo-localdir.el (elmo-folder-append-messages): Don't cause an error
when msgdb is not loaded.
2003-07-22 Yuuichi Teranishi <teranisi@gohome.org>
+ * elmo-pop3.el (elmo-pop3-exists-exactly): Set default value as nil.
+ (elmo-pop3-get-session): Make msgdb directory after session.
+ (elmo-folder-exists-p): Check exactly at the first time even when the
+ elmo-pop3-exists-exactly is nil.
+
+ * elmo-pipe.el (elmo-folder-open-internal): Don't drain here.
+ (elmo-folder-list-messages): Define instead of
+ elmo-folder-list-messages-internal.
+ (elmo-folder-check): Check destination folder.
+ (elmo-folder-synchronize): Drain the pipe.
+
+ * elmo-localdir.el (elmo-folder-append-messages): Don't cause an error
+ when msgdb is not loaded.
+
* elmo-msgdb.el (elmo-msgdb-append-to-killed-list): Abolish.
* elmo-imap4.el (elmo-folder-list-messages-plugged): Fixed.
(table (elmo-flag-table-load (elmo-folder-msgdb-path folder)))
(succeeds numbers)
(next-num (1+ (car (elmo-folder-status folder))))
- mark flag)
+ mark flag id)
(while numbers
(setq mark (elmo-message-mark src-folder (car numbers))
flag (cond
(int-to-string
(if same-number (car numbers) next-num))
dir))
- (elmo-flag-table-set table
- (elmo-message-field
- src-folder (car numbers)
- 'message-id)
- flag)
+ ;; src folder's msgdb is loaded.
+ (when (setq id (elmo-message-field src-folder (car numbers)
+ 'message-id))
+ (elmo-flag-table-set table id flag))
(elmo-progress-notify 'elmo-folder-move-messages)
(if (and (setq numbers (cdr numbers))
(not same-number))
copied-list))
(luna-define-method elmo-folder-open-internal ((folder elmo-pipe-folder))
- (elmo-folder-open-internal (elmo-pipe-folder-dst-internal folder))
- (let ((src-folder (elmo-pipe-folder-src-internal folder))
- (dst-folder (elmo-pipe-folder-dst-internal folder)))
- (when (and (elmo-folder-plugged-p src-folder)
- (elmo-folder-plugged-p dst-folder))
- (if (elmo-pipe-folder-copy-internal folder)
- (elmo-pipe-folder-copied-list-save
- folder
- (elmo-pipe-drain src-folder
- dst-folder
- 'copy
- (elmo-pipe-folder-copied-list-load folder)))
- (elmo-pipe-drain src-folder dst-folder)))))
+ (elmo-folder-open-internal (elmo-pipe-folder-dst-internal folder)))
(luna-define-method elmo-folder-close-internal ((folder elmo-pipe-folder))
(elmo-folder-close-internal(elmo-pipe-folder-dst-internal folder)))
-(luna-define-method elmo-folder-list-messages-internal
- ((folder elmo-pipe-folder) &optional nohide)
- (elmo-folder-list-messages-internal (elmo-pipe-folder-dst-internal
- folder) nohide))
+(luna-define-method elmo-folder-list-messages ((folder elmo-pipe-folder)
+ &optional visible-only in-msgdb)
+ ;; Use target folder's killed-list in the pipe folder.
+ (elmo-folder-list-messages (elmo-pipe-folder-dst-internal
+ folder) visible-only in-msgdb))
(luna-define-method elmo-folder-list-unreads ((folder elmo-pipe-folder))
(elmo-folder-list-unreads (elmo-pipe-folder-dst-internal folder)))
(elmo-message-use-cache-p (elmo-pipe-folder-dst-internal folder) number))
(luna-define-method elmo-folder-check ((folder elmo-pipe-folder))
- (elmo-folder-close-internal folder)
- (elmo-folder-open-internal folder))
+ (elmo-folder-check (elmo-pipe-folder-dst-internal folder)))
(luna-define-method elmo-folder-plugged-p ((folder elmo-pipe-folder))
(and (elmo-folder-plugged-p (elmo-pipe-folder-src-internal folder))
(luna-define-method elmo-folder-synchronize ((folder elmo-pipe-folder)
&optional ignore-msgdb
no-check)
+ (let ((src-folder (elmo-pipe-folder-src-internal folder))
+ (dst-folder (elmo-pipe-folder-dst-internal folder)))
+ (when (and (elmo-folder-plugged-p src-folder)
+ (elmo-folder-plugged-p dst-folder))
+ (if (elmo-pipe-folder-copy-internal folder)
+ (elmo-pipe-folder-copied-list-save
+ folder
+ (elmo-pipe-drain src-folder
+ dst-folder
+ 'copy
+ (elmo-pipe-folder-copied-list-load folder)))
+ (elmo-pipe-drain src-folder dst-folder))))
(elmo-folder-synchronize
(elmo-pipe-folder-dst-internal folder) ignore-msgdb no-check))
If server doesn't accept asynchronous commands, this variable should be
set as non-nil.")
-(defvar elmo-pop3-exists-exactly t)
+(defcustom elmo-pop3-exists-exactly nil
+ "If non-nil, POP3 folder existence is checked everytime before the session."
+ :type 'boolean
+ :group 'elmo)
+
(defvar sasl-mechanism-alist)
(defvar elmo-pop3-total-size nil)
nil
(elmo-pop3-folder-use-uidl-internal
folder))))
- (if (eq if-exists 'any-exists)
- (or (elmo-network-get-session 'elmo-pop3-session
- "POP3"
- folder if-exists)
- (elmo-network-get-session 'elmo-pop3-session
- "BIFF-POP3"
- folder if-exists))
- (elmo-network-get-session 'elmo-pop3-session
- (concat
- (if (elmo-folder-biff-internal folder)
- "BIFF-")
- "POP3")
- folder if-exists))))
+ (prog1
+ (if (eq if-exists 'any-exists)
+ (or (elmo-network-get-session 'elmo-pop3-session
+ "POP3"
+ folder if-exists)
+ (elmo-network-get-session 'elmo-pop3-session
+ "BIFF-POP3"
+ folder if-exists))
+ (elmo-network-get-session 'elmo-pop3-session
+ (concat
+ (if (elmo-folder-biff-internal folder)
+ "BIFF-")
+ "POP3")
+ folder if-exists))
+ ;; For saving existency.
+ (unless (file-exists-p (elmo-folder-msgdb-path folder))
+ (elmo-make-directory (elmo-folder-msgdb-path folder))))))
(defun elmo-pop3-send-command (process command &optional no-erase no-log)
(with-current-buffer (process-buffer process)
(setq session (elmo-pop3-get-session folder))
(if session
(elmo-network-close-session session)))))
- (file-directory-p (elmo-folder-msgdb-path folder))))
+ (or (file-directory-p (elmo-folder-msgdb-path folder))
+ ;; First time.
+ (when (elmo-folder-plugged-p folder)
+ (let ((elmo-pop3-exists-exactly t))
+ (elmo-folder-exists-p folder))))))
(defun elmo-pop3-parse-uidl-response (string)
(let ((buffer (current-buffer))