index-mail.c revision 641f0c0900ee6e7cf9667f4b40ed95cec7d0cdca
/* Copyright (C) 2002-2003 Timo Sirainen */
#include "lib.h"
#include "buffer.h"
#include "istream.h"
#include "str.h"
#include "message-date.h"
#include "message-part-serialize.h"
#include "message-parser.h"
#include "imap-bodystructure.h"
#include "imap-envelope.h"
#include "mail-cache.h"
#include "index-storage.h"
#include "index-mail.h"
{
struct message_part *part;
const void *part_data;
const char *error;
return NULL;
}
/* unexpected - must be an error */
return NULL;
}
&error);
"Corrupted cached message_part data (%s)", error);
return NULL;
}
/* we know the NULs now, update them */
} else {
}
return part;
}
enum mail_cache_field field)
{
const char *ret;
return NULL;
}
}
enum mail_cache_field field)
{
}
return uoff;
}
{
}
{
time_t t;
&t, sizeof(t))) {
t = (time_t)-1;
}
return t;
}
struct mail_sent_date *sent_date)
{
}
}
{
return TRUE;
return FALSE;
return TRUE;
}
enum mail_cache_field field)
{
return FALSE;
// FIXME: check if we really want to cache this
return FALSE;
/* cached_fields may have changed, recheck */
return FALSE;
return TRUE;
}
{
return;
}
{
/*FIXME:data->flags.custom_flags =
mail_custom_flags_list_get(mail->ibox->index->custom_flags);
data->flags.custom_flags_count = MAIL_CUSTOM_FLAGS_COUNT;*/
}
{
}
if (!index_mail_parse_headers(mail))
return NULL;
}
}
{
const char *str;
int tz;
}
/* 0 == parse error */
tz = 0;
}
}
}
}
{
else
}
}
}
{
}
if (get_msgpart_sizes(mail))
return (uoff_t)-1;
}
struct message_header_line *hdr,
void *context)
{
}
{
const void *buf_data;
if (data->bodystructure_header_parsed) {
} else {
}
return;
/* we know the NULs now, update them */
} else {
}
return;
/* update index_flags */
else
return;
t_push();
t_pop();
}
}
struct message_size *hdr_size,
struct message_size *body_size)
{
(void)get_msgpart_sizes(mail);
if (!data->hdr_size_set) {
if (!index_mail_parse_headers(mail))
return NULL;
}
}
if (!data->body_size_set)
}
}
}
enum mail_fetch_field field)
{
enum mail_cache_field cache_field;
char *str;
switch (field) {
case MAIL_FETCH_IMAP_BODY:
}
/* fall through */
}
if (field == MAIL_FETCH_IMAP_BODYSTRUCTURE)
return data->bodystructure;
/* create BODY from cached BODYSTRUCTURE */
t_push();
data->bodystructure));
t_pop();
"Corrupted BODYSTRUCTURE");
}
}
if (!data->bodystructure_header_parsed) {
if (!index_mail_parse_headers(mail))
return NULL;
}
} else {
}
t_push();
t_pop();
/* should never fail */
if (field == MAIL_FETCH_IMAP_BODYSTRUCTURE)
else
return str;
case MAIL_FETCH_IMAP_ENVELOPE:
case MAIL_FETCH_FROM_ENVELOPE:
return NULL;
default:
i_unreached();
return NULL;
}
}
void index_mail_init(struct index_transaction_context *t,
struct index_mail *mail,
const char *const wanted_headers[])
{
}
{
}
const struct mail_index_record *rec,
{
t_push();
(index_flags & MAIL_INDEX_FLAG_HAS_NO_NULS) != 0;
/* if some wanted fields are cached, get them */
}
}
/* see if we have to parse the message */
else
ret = 1;
} else {
/* check this only after open_mail() */
}
ret = 1;
}
t_pop();
return ret;
}
{
t_push();
t_pop();
}
const struct mail_full_flags *flags,
enum modify_type modify_type)
{
enum mail_flags modify_flags;
/* \Recent can't be changed */
/*if (!index_mailbox_fix_custom_flags(ibox, &modify_flags,
flags->custom_flags,
flags->custom_flags_count))
return FALSE;*/
/*if (mail_custom_flags_has_changes(ibox->index->custom_flags)) {
storage->callbacks->new_custom_flags(&ibox->box,
mail_custom_flags_list_get(ibox->index->custom_flags),
MAIL_CUSTOM_FLAGS_COUNT, storage->callback_context);
}*/
return 0;
}
{
return 0;
}