if (imap_read_line (buf, sizeof (buf), ctx->fd) < 0)
if (imap_read_line (buf, sizeof (buf), CTX_DATA->conn) < 0)
int imap_fetch_message (MESSAGE *msg, CONTEXT *ctx, int msgno){  char seq[8];  char buf[LONG_STRING];  char path[_POSIX_PATH_MAX];  char *pc;  char *pn;  long bytes;  IMAP_CACHE *cache;  /* see if we already have the message in our cache */  cache = &((IMAP_DATA *) ctx->data)->cache[ctx->hdrs[msgno]->index % IMAP_CACHE_LEN];  if (cache->path)  {    if (cache->index == ctx->hdrs[msgno]->index)    {      /* yes, so just return a pointer to the message */      if (!(msg->fp = fopen (cache->path, "r")))      {	mutt_perror (cache->path);	return (-1);      }      return 0;    }    else    {      /* clear the previous entry */      unlink (cache->path);      free (cache->path);    }  }  mutt_message ("Fetching message...");  cache->index = ctx->hdrs[msgno]->index;  mutt_mktemp (path);  cache->path = safe_strdup (path);  if (!(msg->fp = safe_fopen (path, "w+")))  {    safe_free ((void **) &cache->path);    return (-1);  }  imap_make_sequence (seq, sizeof (seq), ctx);  snprintf (buf, sizeof (buf), "%s FETCH %d RFC822\r\n", seq,	    ctx->hdrs[msgno]->index + 1);  imap_write (ctx->fd, buf);  do  {    if (imap_read_line (buf, sizeof (buf), ctx->fd) < 0)    {      return (-1);    }    if (buf[0] == '*')    {      pc = buf;      pc = imap_next_word (pc);      pc = imap_next_word (pc);      if (strncasecmp ("FETCH", pc, 5) == 0)      {	if (!(pc = strchr (buf, '{')))	{	  imap_error ("imap_fetch_message()", buf);	  return (-1);	}	pc++;	pn = pc;	while (isdigit (*pc))	  pc++;	*pc = 0;	bytes = atoi (pn);	imap_read_bytes (msg->fp, ctx->fd, bytes);      }      else if (imap_handle_untagged (ctx, buf) != 0)	return (-1);    }  }  while (strncmp (buf, seq, SEQLEN) != 0)    ;  if (!imap_code (buf))  {    return (-1);  }  return 0;}