index-mail.h revision 87460b08cb97b31cde640d4975a6aa2c1d0e7226
#ifndef __INDEX_MAIL_H
#define __INDEX_MAIL_H
#include "message-size.h"
#include "mail-cache.h"
#include "mail-storage-private.h"
enum index_cache_field {
/* fixed size fields */
MAIL_CACHE_FLAGS = 0,
/* variable sized field */
};
enum mail_cache_record_flag {
/* If binary flags are set, it's not checked whether mail is
missing CRs. So this flag may be set as an optimization for
regular non-binary mails as well if it's known that it contains
valid CR+LF line breaks. */
MAIL_CACHE_FLAG_BINARY_HEADER = 0x0001,
MAIL_CACHE_FLAG_BINARY_BODY = 0x0002,
/* Mail header or body is known to contain NUL characters. */
MAIL_CACHE_FLAG_HAS_NULS = 0x0004,
/* Mail header or body is known to not contain NUL characters. */
MAIL_CACHE_FLAG_HAS_NO_NULS = 0x0008
};
struct mail_sent_date {
};
struct index_mail_line {
unsigned int field_idx;
unsigned int cache:1;
};
struct message_header_line;
struct index_mail_data {
enum mail_flags flags;
const char *const *keywords;
struct mail_sent_date sent_date;
struct index_mail_line parse_line;
struct message_part *parts;
struct message_part_envelope_data *envelope_data;
const struct mail_index_record *rec;
struct message_parser_ctx *parser_ctx;
int parsing_count;
unsigned int parse_header:1;
unsigned int save_envelope:1;
unsigned int save_sent_date:1;
unsigned int save_bodystructure_header:1;
unsigned int save_bodystructure_body:1;
unsigned int parsed_bodystructure:1;
unsigned int hdr_size_set:1;
unsigned int body_size_set:1;
unsigned int open_mail:1;
};
struct index_mail {
struct mail_private mail;
struct index_mail_data data;
struct index_mailbox *ibox;
struct index_transaction_context *trans;
struct index_header_lookup_ctx *wanted_headers;
/* per-mail variables, here for performance reasons: */
};
struct mail *
index_mail_alloc(struct mailbox_transaction_context *t,
struct mailbox_header_lookup_ctx *wanted_headers);
struct mailbox_header_lookup_ctx *headers);
struct message_header_line *hdr,
struct index_mail *mail);
struct mailbox_header_lookup_ctx *headers);
const char *const *
struct istream *
struct mailbox_header_lookup_ctx *headers);
struct message_size *hdr_size,
struct message_size *body_size);
enum mail_fetch_field field);
enum mail_flags flags);
struct mail_keywords *keywords);
enum index_cache_field field);
enum index_cache_field field);
#endif