dbox-mail.c revision 4b41116563110d00330896a568eff1078c382827
/* Copyright (C) 2005 Timo Sirainen */
#include "lib.h"
#include "ioloop.h"
#include "hex-dec.h"
#include "read-full.h"
#include "istream.h"
#include "index-mail.h"
#include "dbox-file.h"
#include "dbox-sync.h"
#include "dbox-storage.h"
#include <fcntl.h>
#include <unistd.h>
{
struct dbox_mailbox *mbox =
"dbox %s: Cached file offset broken",
/* make sure we get it fixed */
return -1;
}
/* Note that the mail may already have an expunge flag, but we don't
care since we can still read it */
return 1;
}
{
struct dbox_mailbox *mbox =
int ret;
for (;;) {
if (ret <= 0)
return ret;
if (*file_seq_r != 0)
return 1;
if (synced)
return -1;
return -1;
}
"Cached message offset lost for uid %u in "
/* resync and try again */
return -1;
}
}
int *ret_r)
{
struct dbox_transaction_context *t =
if (*ret_r <= 0) {
if (*ret_r == 0)
return TRUE;
}
seq >= t->first_saved_mail_seq)) < 0)
return TRUE;
if (*ret_r > 0) {
/* ok */
return TRUE;
}
return FALSE;
}
{
uoff_t prev_offset = 0;
int i, ret;
return 0;
for (i = 0; i < 3; i++) {
return ret;
/* broken offset */
break;
} else {
/* mail was moved. resync dbox to find out the new
offset and try again. */
return -1;
}
prev_offset = *offset_r;
}
"broken for uid %u in dbox %s",
return -1;
return ret;
return -1;
}
{
uint32_t t;
(void)index_mail_get_received_date(_mail);
return data->received_date;
return (time_t)-1;
/* it's broken and conflicts with our "not found"
return value. change it. */
data->received_date = 0;
}
t = data->received_date;
return data->received_date;
}
{
(void)index_mail_get_save_date(_mail);
return (time_t)-1;
/* it's broken and conflicts with our "not found"
return value. change it. */
}
}
{
(void)index_mail_get_physical_size(_mail);
return data->physical_size;
return (uoff_t)-1;
return data->physical_size;
}
static struct istream *
struct message_size *hdr_size,
struct message_size *body_size)
{
return NULL;
}
}
struct mail_vfuncs dbox_mail_vfuncs = {
dbox_mail_get_physical_size, /* physical = virtual in our case */
};