if (imap_check_capabilities(idata) != 0 || imap_authenticate (idata) != 0) { mutt_socket_close (idata->conn); idata->state = IMAP_DISCONNECTED; return -1; }
if (imap_check_capabilities (idata) || imap_authenticate (idata)) goto bail;
int imap_open_connection (IMAP_DATA* idata){  char buf[LONG_STRING];  if (mutt_socket_open (idata->conn) < 0)    return -1;  idata->state = IMAP_CONNECTED;  if (mutt_socket_readln (buf, sizeof (buf), idata->conn) < 0)  {    mutt_socket_close (idata->conn);    idata->state = IMAP_DISCONNECTED;    return -1;  }  if (mutt_strncmp ("* OK", buf, 4) == 0)  {    if (imap_check_capabilities(idata) != 0 	|| imap_authenticate (idata) != 0)    {      mutt_socket_close (idata->conn);      idata->state = IMAP_DISCONNECTED;      return -1;    }  }  else if (mutt_strncmp ("* PREAUTH", buf, 9) == 0)  {    if (imap_check_capabilities(idata) != 0)    {      mutt_socket_close (idata->conn);      idata->state = IMAP_DISCONNECTED;      return -1;    }  }   else  {    imap_error ("imap_open_connection()", buf);    mutt_socket_close (idata->conn);    idata->state = IMAP_DISCONNECTED;    return -1;  }  idata->state = IMAP_AUTHENTICATED;  imap_get_delim (idata);  return 0;}