;;; -*-Scheme-*-
;;;
-;;; $Id: imail-imap.scm,v 1.126 2000/06/24 01:37:56 cph Exp $
+;;; $Id: imail-imap.scm,v 1.127 2000/06/29 17:51:06 cph Exp $
;;;
;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
;;;
(if-unique (car responses)))))))
(define (imap-mailbox-completions mailbox url)
- (map (lambda (response)
- (let ((mailbox (imap:response:list-mailbox response))
- (delimiter (imap:response:list-delimiter response)))
- (if (and delimiter
- (memq '\NOSELECT (imap:response:list-flags response)))
- (string-append mailbox delimiter)
- mailbox)))
- (with-open-imap-connection url
- (lambda (connection)
- (imap:command:list connection "" (string-append mailbox "%"))))))
+ (with-open-imap-connection url
+ (lambda (connection)
+ (let ((get-list
+ (lambda (prefix)
+ (imap:command:list connection "" (string-append prefix "%")))))
+ (append-map!
+ (lambda (response)
+ (let ((flags (imap:response:list-flags response))
+ (delimiter (imap:response:list-delimiter response))
+ (mailbox (imap:response:list-mailbox response)))
+ (let ((tail
+ (if (or (not delimiter) (memq '\NOINFERIORS flags))
+ '()
+ (let ((container (string-append mailbox delimiter)))
+ (if (pair? (get-list container))
+ (list container)
+ '())))))
+ (if (memq '\NOSELECT flags)
+ tail
+ (cons mailbox tail)))))
+ (get-list mailbox))))))
\f
;;;; Server connection
IMAIL To-Do List
-$Id: todo.txt,v 1.100 2000/06/29 03:46:05 cph Exp $
+$Id: todo.txt,v 1.101 2000/06/29 17:51:01 cph Exp $
Bug fixes
---------
-* IMAP URL completion must handle folders that contain both messages
- and subfolders differently. Such folders should appear twice in the
- completion list: once with no delimiter suffix, and once with a
- delimiter suffix. That way when the user completes such a folder,
- the message "complete, but not unique" will be shown, and it will be
- obvious there are subfolders. As it now stands, there's no way to
- tell there are subfolders other than by adding the delimiter suffix
- and re-completing.
-
* Must be able to handle malformed headers in incoming mail.
Generating a low-level error in this situation is unacceptable.