Exemplo n.º 1
0
static int
pop_get_size (mu_mailbox_t mbox, mu_off_t *psize)
{
  struct _pop3_mailbox *mpd = mbox->data;
  int status = 0;

  if (mpd == NULL)
    return EINVAL;

  if (!pop_is_updated (mbox))
    status = pop_messages_count (mbox, NULL);
  if (psize)
    *psize = mpd->total_size;
  return status;
}
Exemplo n.º 2
0
static int
pop_message_lines (mu_message_t msg, size_t *plines, int quick)
{
  int rc;
  struct _pop3_message *mpm = mu_message_get_owner (msg);

  if (!(mpm->flags & _POP3_MSG_LINES))
    {
      if (quick && !(mpm->flags & _POP3_MSG_CACHED))
	return MU_ERR_INFO_UNAVAILABLE;
      if (!pop_is_updated (mpm->mpd->mbox))
	pop_scan (mpm->mpd->mbox, 1, NULL);
      rc = pop_scan_message (mpm);
      if (rc)
	return rc;
      mpm->message_lines = mpm->header_lines + mpm->body_lines + 1;
      mpm->flags |= _POP3_MSG_LINES;
    }

  *plines = mpm->message_lines;
  return 0;
}