]> granicus.if.org Git - mutt/commitdiff
IMAP cosmetics from Brendan Cully.
authorThomas Roessler <roessler@does-not-exist.org>
Wed, 5 Jul 2000 08:05:03 +0000 (08:05 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Wed, 5 Jul 2000 08:05:03 +0000 (08:05 +0000)
imap/BUGS
imap/TODO
imap/auth.c
imap/imap.c
imap/socket.c

index 04d2e1a0dc5bb458191cbac7fcf421f79b20b308..7574ca67c2ffc8f83a9804efc47d7b2301ea6956 100644 (file)
--- a/imap/BUGS
+++ b/imap/BUGS
@@ -38,9 +38,7 @@ In no particular order:
       imap_sync_mailbox, otherwise shouldn't be too bad. Not currently a
       major priority, though - noone's gotten bit by this.
 
-* Have a hard time when the home namespace isn't default "".
-
 * The mutt_pretty routines don't work well when the delimiter isn't '/'.
 
 Brendan Cully <brendan@kublai.com>
-Updated 20000304
+Updated 20000704
index 328cd0b0723d5986232e89616f9f6c18aa340873..c27817bd3344f2c02189c6fd72b1c82f44df41e1 100644 (file)
--- a/imap/TODO
+++ b/imap/TODO
@@ -1,6 +1,7 @@
 IMAP enhancements, by priority:
 
 [ -- socket -- ]
+
 * Smarter connection code. Mutt should handle dropped connections/routing
   problems gracefully. It should be able to transparently reconnect. This
   is facilitated by the next item.
@@ -14,26 +15,15 @@ IMAP enhancements, by priority:
   PRIORITY: [***]
 
 [ -- browsing -- ]
-* Investigate a new way of displaying folders with subfolders and messages.
-  Possibly we could use a tree-view in the browser, w/ expand, collapse.
-  For low-bandwidth lines we could defer getting subfolder lists until the
-  folder is expanded.
-  Current thought is that <ENTER> will select a mailbox if it doesn't have
-  subfolders or enter the folder if it does. If it has messages and subfolders,
-  we'll use a new key to select it as a mailbox.
-  We should maybe add a new imap_format string for IMAP browsing, without all
+
+* We should maybe add a new imap_format string for IMAP browsing, without all
   the stat variables but with tags like how many messages are in the folders,
   how many subfolders, that weird \Marked tag, etc.
  
   PRIORITY: [** ]
 
-* See if we can't add more info to the IMAP browser than just name (without
-  incurring too much overhead). eg which folders contain new mail, size,
-  number of messages.
-
-  PRIORITY: [** ]
-
 [ -- speed -- ]
+
 * Persistent caching of data. I think the nicest way to do this is to store
   local copies like IMAP does, with an invisible control message at the top,
   and extra invisible headers in the message (for UID/dirty bits). This does
@@ -57,9 +47,6 @@ IMAP enhancements, by priority:
   PRIORITY: [*  ]
 
 [ -- new features -- ]
-* Implement the received folder on IMAP, now that COPY is done
-
-  PRIORITY: [** ]
 
 * Commands for creating/deleting folders on the server, since users may not
   otherwise be able to do this on IMAP servers.
@@ -67,17 +54,9 @@ IMAP enhancements, by priority:
 
   PRIORITY: [** ]
 
-* Implement READ-ONLY support, and the x (quit without saving changes)
-  command.
+* Implement the x (quit without saving changes) command.
 
   PRIORITY: [** ]
 
-* Create a logout command, so users can reconnect with different account
-  information without quitting mutt. Note: Tommi Komulainen's
-  multiple-account code makes this unnecessary - just use an account of
-  the form {username@host}
-
-  PRIORITY: [*  ]
-
 Brendan Cully <brendan@kublai.com>
-Updated: 19991227
+Updated: 20000704
index e321585a4f84b71aa95ffc17b791b46e02aa89fe..c729da5dbd31653878e753b8dc904cf94f4b950a 100644 (file)
@@ -374,7 +374,7 @@ int imap_authenticate (IMAP_DATA *idata, CONNECTION *conn)
     if (r == -1)
     {
       /* connection or protocol problem */
-      imap_error ("imap_open_connection()", buf);
+      imap_error ("imap_authenticate", buf);
       return (-1);
     }
     else if (r == -2)
index a532353807213541f538100b2654311283aec528..c796c2d5758a25b089b3d7101da35d0ae3074540 100644 (file)
@@ -529,7 +529,7 @@ int imap_open_mailbox (CONTEXT *ctx)
   IMAP_DATA *idata;
   char buf[LONG_STRING];
   char bufout[LONG_STRING];
-  char seq[16];
+  char seq[SEQLEN+1];
   int count = 0;
   int n;
   IMAP_MBOX mx;
@@ -556,7 +556,7 @@ int imap_open_mailbox (CONTEXT *ctx)
       idata->conn = conn;
     }
     if (imap_open_connection (idata, conn))
-      return (-1);
+      return -1;
   }
   ctx->data = (void *) idata;
 
index faa6d8e1aec9ca31144a3e9c1db1f7a0c626855b..2b97bca74191b46008ae71d1d58b4c7d96f7705e 100644 (file)
@@ -99,10 +99,16 @@ int mutt_socket_read_line_d (char *buf, size_t buflen, CONNECTION *conn)
   return r;
 }
 
-static int imap_user_match (const IMAP_MBOX *m1, const IMAP_MBOX *m2)
+/* imap_account_match: compare account info (host/port/user) */
+static int imap_account_match (const IMAP_MBOX *m1, const IMAP_MBOX *m2)
 {
   const char *user = ImapUser ? ImapUser : NONULL (Username);
 
+  if (mutt_strcasecmp (m1->host, m2->host))
+    return 0;
+  if (m1->port != m2->port)
+    return 0;
+  
   if (m1->flags & m2->flags & M_IMAP_USER)
     return (!strcmp (m1->user, m2->user));
   if (m1->flags & M_IMAP_USER)
@@ -121,7 +127,7 @@ CONNECTION *mutt_socket_select_connection (const IMAP_MBOX *mx, int newconn)
     conn = Connections;
     while (conn)
     {
-      if (!mutt_strcasecmp (mx->host, conn->mx.host) && (mx->port == conn->mx.port) && imap_user_match (mx, &conn->mx))
+      if (imap_account_match (mx, &conn->mx))
        return conn;
       conn = conn->next;
     }
@@ -254,8 +260,9 @@ int raw_socket_open (CONNECTION *conn)
   sin.sin_family = AF_INET;
   if ((he = gethostbyname (conn->mx.host)) == NULL)
   {
-    mutt_perror (conn->mx.host);
-    return (-1);
+    mutt_error (_("Could not find the host \"%s\""), conn->mx.host);
+       
+    return -1;
   }
   memcpy (&sin.sin_addr, he->h_addr_list[0], he->h_length);