mbox-mail.c revision d30da25fb6be1f1c667d93767c9194000194b618
/* Copyright (C) 2003 Timo Sirainen */
#include "lib.h"
#include "istream.h"
#include "index-mail.h"
#include "mbox-storage.h"
#include "mbox-file.h"
#include "mbox-lock.h"
#include "mbox-sync-private.h"
#include "istream-raw-mbox.h"
#include "istream-header-filter.h"
#include <fcntl.h>
#include <unistd.h>
{
struct mbox_transaction_context *t =
enum mbox_sync_flags sync_flags = 0;
return 0;
return -1;
/* refresh index file after mbox has been locked to make
sure we get only up-to-date mbox offsets. */
return -1;
}
}
if (mbox_file_open_stream(ibox) < 0)
return -1;
&deleted);
if (ret < 0) {
if (deleted) {
return 0;
}
return -1;
}
if (ret == 0) {
/* we'll need to re-sync it completely */
t->mbox_lock_id = 0;
ibox->mbox_lock_id = 0;
}
goto __again;
}
return 1;
}
{
return index_mail_get_flags(_mail);
/*FIXME:struct index_mail *mail = (struct index_mail *)_mail;
struct index_mail_data *data = &mail->data;
i_assert(_mail->seq <= mail->ibox->mbox_data_count);
(void)index_mail_get_flags(_mail);
if ((mail->ibox->mbox_data[_mail->seq-1] & 1) != 0)
data->flags.flags |= MAIL_RECENT;
return &data->flags;*/
}
{
(void)index_mail_get_received_date(_mail);
return data->received_date;
if (mbox_mail_seek(mail) <= 0)
return (time_t)-1;
/* it's broken and conflicts with our "not found"
return value. change it. */
data->received_date = 0;
}
return data->received_date;
}
static const char *
{
if (field == MAIL_FETCH_FROM_ENVELOPE) {
if (mbox_mail_seek(mail) <= 0)
return NULL;
}
}
{
/* our header size varies, so don't do any caching */
return data->physical_size;
}
struct message_size *hdr_size,
struct message_size *body_size)
{
struct istream *raw_stream;
if (mbox_mail_seek(mail) <= 0)
return NULL;
}
}
0, 0, 0, 0, 0, 0,
};