dbox-mail.c revision 427ad9fea54628d52f04c8a76269749a8e6fae7a
/* Copyright (c) 2007-2010 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "istream.h"
#include "str.h"
#include "index-storage.h"
#include "index-mail.h"
#include "dbox-attachment.h"
#include "dbox-storage.h"
#include "dbox-file.h"
#include "dbox-mail.h"
#include <stdlib.h>
struct mail *
dbox_mail_alloc(struct mailbox_transaction_context *t,
struct mailbox_header_lookup_ctx *wanted_headers)
{
}
{
/* close the dbox file only after index is closed, since it may still
try to read from it. */
}
{
struct dbox_storage *storage =
return -1;
return -1;
if (dbox_file_metadata_read(*file_r) <= 0)
return -1;
/* we just messed up mail's input stream by reading metadata */
}
return 0;
}
static int
const char **value_r)
{
return -1;
return 0;
}
{
return 0;
return -1;
return 0;
}
{
const char *value;
return 0;
&value) < 0)
return -1;
return 0;
}
{
const char *value;
return 0;
&value) < 0)
return -1;
return 0;
}
{
struct dbox_storage *storage =
return 0;
return -1;
return -1;
}
return 0;
}
static int
enum index_cache_field cache_field,
const char **value_r)
{
struct index_mailbox_context *ibox =
const char *value;
return 0;
}
return -1;
value = "";
/* don't return pointer to dbox metadata directly, since it may
change unexpectedly */
str_truncate(str, 0);
return 0;
}
const char **value_r)
{
/* keep the UIDL in cache file, otherwise POP3 would open all
mail files and read the metadata. same for GUIDs if they're
used. */
switch (field) {
case MAIL_FETCH_UIDL_BACKEND:
case MAIL_FETCH_GUID:
default:
break;
}
}
static int
{
int ret;
return ret;
return -1;
}
return 1;
else
}
struct message_size *body_size,
{
struct dbox_storage *storage =
int ret;
return -1;
if (ret <= 0) {
if (ret < 0)
return -1;
"uid=%u points to broken data at offset="
return -1;
}
}
stream_r);
}