]> granicus.if.org Git - neomutt/commitdiff
. Add $imap_idle boolean to disable the IDLE extension (may be needed with some
authorBrendan Cully <brendan@kublai.com>
Mon, 12 Dec 2005 17:24:11 +0000 (17:24 +0000)
committerBrendan Cully <brendan@kublai.com>
Mon, 12 Dec 2005 17:24:11 +0000 (17:24 +0000)
  servers like the particular version of dovecot I tried yesterday).
. Don't attempt to poll mailboxes with connections that haven't yet
  authenticated.
. Recognize NO responses again (silly typo, spotted by Charlie Allom)

imap/command.c
imap/imap.c
init.h
mutt.h

index 0d3c380c20fc47641d49ec5513ca1485907772c4..8ba51fbc8752ee5c7ecc6a84bdaf8ab1fd74ced2 100644 (file)
@@ -337,7 +337,7 @@ static int cmd_status (const char *s)
   
   if (!ascii_strncasecmp("OK", s, 2))
     return IMAP_CMD_OK;
-  if (!ascii_strncasecmp("NO", s, 3))
+  if (!ascii_strncasecmp("NO", s, 2))
     return IMAP_CMD_NO;
 
   return IMAP_CMD_BAD;
index 4b6e293a2b4970e5e9f7c5e60910e129082775e9..ba01c67429b526976c1a326425bba85966832e78 100644 (file)
@@ -1185,7 +1185,7 @@ int imap_check_mailbox (CONTEXT *ctx, int *index_hint, int force)
   idata = (IMAP_DATA*) ctx->data;
 
   /* try IDLE first */
-  if (mutt_bit_isset (idata->capabilities, IDLE)
+  if (option (OPTIMAPIDLE) && mutt_bit_isset (idata->capabilities, IDLE)
       && (idata->state != IMAP_IDLE
           || time(NULL) >= idata->lastread + ImapKeepalive))
   {
@@ -1238,7 +1238,8 @@ static int imap_buffy_split (const char* path, IMAP_DATA** hidata, char* buf, si
     dprint (1, (debugfile, "imap_split_path: Error parsing %s\n", path));
     return -1;
   }
-  if (!(*hidata = imap_conn_find (&(mx.account), option (OPTIMAPPASSIVE) ? M_IMAP_CONN_NONEW : 0)))
+  if (!(*hidata = imap_conn_find (&(mx.account), option (OPTIMAPPASSIVE) ? M_IMAP_CONN_NONEW : 0))
+      || (*hidata)->state < IMAP_AUTHENTICATED)
   {
     FREE (&mx.mbox);
     return -1;
diff --git a/init.h b/init.h
index 6a3facf4f450fc82f4ea142dc18bc50d8ab75e8b..e1d6d78f5bee49b3c2e33145c89a489312af61f0 100644 (file)
--- a/init.h
+++ b/init.h
@@ -848,6 +848,15 @@ struct option_t MuttVars[] = {
   ** your INBOX in the IMAP browser. If you see something else, you may set
   ** this variable to the IMAP path to your folders.
   */
+  { "imap_idle",                DT_BOOL, R_NONE, OPTIMAPIDLE, 1 },
+  /*
+   ** .pp
+   ** When \fIset\fP, mutt will attempt to use the IMAP IDLE extension
+   ** to check for new mail in the current mailbox. Some servers
+   ** (dovecot was the inspiration for this option) react badly
+   ** to mutt's implementation. If your connection seems to freeze
+   ** up periodically, try unsetting this.
+   */
   { "imap_keepalive",           DT_NUM,  R_NONE, UL &ImapKeepalive, 900 },
   /*
   ** .pp
diff --git a/mutt.h b/mutt.h
index d57b7d807d671f9460ce01da2fdcd4905aa65e16..7bb6823d2f73d7f1170f6014124220e2704d6401 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -370,6 +370,7 @@ enum
   OPTIGNORELISTREPLYTO,
 #ifdef USE_IMAP
   OPTIMAPCHECKSUBSCRIBED,
+  OPTIMAPIDLE,
   OPTIMAPLSUB,
   OPTIMAPPASSIVE,
   OPTIMAPPEEK,