]> granicus.if.org Git - mutt/commitdiff
IMAP path canonicalization. From Brendan Cully.
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 7 May 2001 19:21:40 +0000 (19:21 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 7 May 2001 19:21:40 +0000 (19:21 +0000)
imap/README
imap/imap.h
imap/util.c
muttlib.c

index 13d56d853496433f7460830cb095d42d973abe87..6b73f7e0b2407922eebee78ea0c03ae79680855e 100644 (file)
@@ -1,30 +1,31 @@
-Mutt's IMAP support is still experimental, in that it hasn't been tested on
-a wide variety of servers and machines. It may contain memory leaks, dangling
-pointers, and other nasty problems. IWFM. YMMV. Caveant emptor lectorque.
+IMAP in mutt should be considered beta quality. For the most part it
+works well, but it is still not quite as stable or as full-featured
+as some of the other drivers. I believe it is now acceptable for
+daily use (and that's how I use it now, currently against Cyrus 1.6.24 and
+previously against UW-IMAP 4.7 and 2000).
 
-Note in particular that mutt doesn't handle connection timeouts well at all,
-and may often crash in their presence. Please keep backups from within your
-editor of messages that take a long time to write - the longer you take,
-the more likely your connection is to time out, AND the more valuable your
-message probably is.
+You may still lose some work if you are suddenly disconnected from your
+server (but your mailboxes should be fine). Currently accessing the same
+IMAP folder with multiple clients is not supported - it may work, but
+no guarantees. There are still several non-critical known bugs, see
+http://bugs.guug.de/ for the current list.
+
+You may also be disappointed in mutt's handling of very large IMAP mailboxes.
+To build the message index mutt must fetch a subset of headers from every
+message in the mailbox, which costs time and network traffic linear to the
+number of messages in your mailbox.
+
+Nevertheless in general mutt is quite a fast and fully-featured IMAP client.
+It tries to be polite to IMAP servers as well, opening few connections and
+avoiding needless polls of the server, unlike certain other popular IMAP
+clients by certain large corporations :)
+
+Mutt supports almost all official authentication and security protocols for
+IMAP, including SSL/TLS, native CRAM-MD5 and GSSAPI routines, and a SASL
+plugin which can handle just about everything else.
 
 Please report bugs to mutt-dev@mutt.org and/or brendan@kublai.com. Version,
 options, stack-trace and .muttdebug files are a plus.
 
-New features vs. the stable distribution:
-
-* Tab-completion of IMAP folder names
-* Folder browsing
-* Go-fast stripes
-* Postponed-message support
-* Server-side copy
-* Fast sync
-* Secure login (GSSAPI and CRAM-MD5)
-* Attach messages from IMAP folders
-* Use an IMAP path as your Maildir (set folder={...})
-* Preserve message keywords
-* Preserve deleted messages if you don't choose to expunge them
-* Delete mailboxes (from the browser)
-* Multiple IMAP usernames
-* Read-only folder support (toggling read-only is buggy, though)
-* More and better segfaults
+Brendan Cully <brendan@kublai.com>
+20010506
index 3cefa694b1776ae7521b13a2f6a0e1ab421520f0..ae4ae61d3922e65482d32d721ce1358ff6f6de40 100644 (file)
@@ -61,6 +61,7 @@ int imap_fetch_message (MESSAGE* msg, CONTEXT* ctx, int msgno);
 void imap_logout_all (void);
 
 /* util.c */
+int imap_expand_path (char* path, size_t len);
 int imap_parse_path (const char* path, IMAP_MBOX* mx);
 void imap_pretty_mailbox (char* path);
 
index 184dee8957d1a155e34ed6ccd318c9b0245233b2..e76d551f59c72c623ff35f137fa147be7012656c 100644 (file)
 
 /* -- public functions -- */
 
+/* imap_expand_path: IMAP implementation of mutt_expand_path. Rewrite
+ *   an IMAP path in canonical and absolute form.
+ * Inputs: a buffer containing an IMAP path, and the number of bytes in
+ *   that buffer.
+ * Outputs: The buffer is rewritten in place with the canonical IMAP path.
+ * Returns 0 on success, or -1 if imap_parse_path chokes or url_ciss_tostring
+ *   fails, which it might if there isn't enough room in the buffer. */
+int imap_expand_path (char* path, size_t len)
+{
+  IMAP_MBOX mx;
+  ciss_url_t url;
+  int rc;
+
+  if (imap_parse_path (path, &mx) < 0)
+    return -1;
+
+  mutt_account_tourl (&mx.account, &url);
+  url.path = mx.mbox;
+
+  rc = url_ciss_tostring (&url, path, len);
+  FREE (&mx.mbox);
+
+  return rc;
+}
+
 /* imap_parse_path: given an IMAP mailbox name, return host, port
  *   and a path IMAP servers will recognise.
  * mx.mbox is malloc'd, caller must free it */
index d7459a3c33fdeb38bfbce178eccd316debf3c510..4f89f089875fe448e65d364fd03fa7ec3354aaf9 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
 #include "mx.h"
 #include "url.h"
 
+#ifdef USE_IMAP
+#include "imap.h"
+#endif
+
 #ifdef HAVE_PGP
 #include "pgp.h"
 #endif
@@ -455,6 +459,13 @@ char *_mutt_expand_path (char *s, size_t slen, int rx)
   }
   while (recurse);
 
+#ifdef USE_IMAP
+  /* Rewrite IMAP path in canonical form - aids in string comparisons of
+   *   folders. May possibly fail, in which case s should be the same. */
+  if (mx_is_imap (s))
+    imap_expand_path (s, slen);
+#endif
+
   return (s);
 }