imapc-mail.c revision 2769852989e20e50b437550bda3489e0950942a6
/* Copyright (c) 2011 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "istream.h"
#include "imap-envelope.h"
#include "imapc-msgmap.h"
#include "imapc-mail.h"
#include "imapc-client.h"
#include "imapc-storage.h"
struct mail *
imapc_mail_alloc(struct mailbox_transaction_context *t,
struct mailbox_header_lookup_ctx *wanted_headers)
{
struct imapc_mail *mail;
}
{
struct imapc_msgmap *msgmap;
/* check if another session has already expunged it */
return TRUE;
}
/* check if we've received EXPUNGE for it */
return TRUE;
/* we may be running against a server that hasn't bothered sending
us an EXPUNGE. see if NOOP sends it. */
}
{
return -1;
/* we've already logged a disconnection error */
return -1;
} else {
"imapc: Remote server didn't send %s for UID %u in %s",
return 0;
}
}
{
return 0;
return -1;
return -1;
/* assume that the server never returns INTERNALDATE
for this mail (see BODY[] failure handling) */
data->received_date = 0;
}
}
return 0;
}
{
/* FIXME */
return -1;
}
return 0;
}
{
int ret;
return -1;
&data->physical_size);
if (ret <= 0) {
"imapc: stat(%s) failed: %m",
return -1;
}
}
return 0;
}
static int
struct message_size *hdr_size,
{
enum mail_fetch_field fetch_field;
/* we've fetched the header, but we need the body now too */
}
if (!data->initialized) {
/* coming here from mail_set_seq() */
return mail_set_aborted(_mail);
}
fetch_field = get_body ||
return -1;
return -1;
/* this could be either a temporary server bug, or the
server may permanently just not return anything for
this mail. the latter happens at least with Exchange
when trying to fetch calendar "mails", so we'll just
return them as empty mails instead of disconnecting
the client. */
}
}
stream_r);
}
static bool
struct mailbox_header_lookup_ctx *headers)
{
unsigned int i;
return FALSE;
}
return TRUE;
}
{
struct mailbox_header_lookup_ctx *header_ctx;
}
/* see if all wanted headers exist in cache */
}
if (data->access_part == 0 &&
/* the common code already checked this partially,
but we need a guaranteed correct answer */
}
}
{
/* searching code handles prefetching internally,
elsewhere we want to do it immediately */
(void)imapc_mail_prefetch(_mail);
}
static void
enum mail_fetch_field fields,
struct mailbox_header_lookup_ctx *headers)
{
}
{
while (mail->fetch_count > 0)
if (mail->body_fetched) {
} else {
}
}
i_error("close(imapc mail) failed: %m");
}
}
{
const enum index_cache_field cache_idx =
return 0;
}
return 0;
}
/* GUID not in cache, fetch it */
return -1;
return -1;
}
return 0;
}
static int
const char **value_r)
{
switch (field) {
case MAIL_FETCH_GUID:
*value_r = "";
default:
break;
}
}
struct mail_vfuncs imapc_mail_vfuncs = {
NULL,
};