mutt_error ("BUG! Untagged IMAP Response during BUFFY Check");
mutt_error _("BUG! Untagged IMAP Response during BUFFY Check");
int imap_buffy_check (char *path){  CONNECTION *conn;  char host[SHORT_STRING];  char buf[LONG_STRING];  char seq[8];  char *mbox;  char *s;  char recent = FALSE;  if (imap_parse_path (path, host, sizeof (host), &mbox))    return -1;  conn = mutt_socket_select_connection (host, IMAP_PORT, 0);  /* Currently, we don't open a connection to check, but we'll check   * over an existing connection */  if (conn->uses == 0)      return (-1);  conn->uses++;  imap_make_sequence (seq, sizeof (seq));  snprintf (buf, sizeof (buf), "%s STATUS %s (RECENT)\r\n", seq, mbox);  mutt_socket_write (conn, buf);  do   {    if (mutt_socket_read_line_d (buf, sizeof (buf), conn) < 0)    {      return (-1);    }    /* BUG: We don't handle other untagged messages here.  This is     * actually because of a more general problem in that this     * connection is being used for a different mailbox, and all     * untagged messages we don't handle here (ie, STATUS) need to be     * sent to imap_handle_untagged() but with the CONTEXT of the     * currently selected mailbox.  The same is broken in the APPEND     * stuff above.     *//*    if (buf[0] == '*' && imap_handle_untagged (ctx, buf) != 0) */    if (buf[0] == '*')    {      s = imap_next_word (buf);      if (strncasecmp ("STATUS", s, 6) == 0)      {	s = imap_next_word (s);	if (strncmp (mbox, s, strlen (mbox)) == 0)	{	  s = imap_next_word (s);	  s = imap_next_word (s);	  if (isdigit (*s))	  {	    if (*s != '0')	    {	      dprint (1, (debugfile, "New mail in %s\n", path));	      recent = TRUE;	    }	  }	}      }      else      {	mutt_error ("BUG! Untagged IMAP Response during BUFFY Check");      }    }  }  while ((strncmp (buf, seq, SEQLEN) != 0));  conn->uses--;  return recent;}