#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 */
};
extern struct mail_cache_field
#define IMAP_BODY_PLAIN_7BIT_ASCII \
"\"text\" \"plain\" (\"charset\" \"us-ascii\") NIL NIL \"7bit\""
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 header or body is known to contain NUL characters. */
/* Mail header or body is known to not contain NUL characters. */
/* obsolete _HAS_NO_NULS flag, which was being set incorrectly */
/* BODY is IMAP_BODY_PLAIN_7BIT_ASCII and rest of BODYSTRUCTURE
fields are NIL */
};
enum index_mail_access_part {
};
struct mail_sent_date {
};
struct index_mail_line {
unsigned int field_idx;
};
struct message_header_line;
struct index_mail_data {
/* dont_cache_fields overrides cache_fields */
unsigned int dont_cache_field_idx;
int parsing_count;
};
struct index_mail {
int pop3_state;
/* per-mail variables, here for performance reasons: */
/* mail created by mailbox_search_*() */
/* close() is being called from mail_free() */
};
struct mail *
index_mail_alloc(struct mailbox_transaction_context *t,
struct mailbox_header_lookup_ctx *wanted_headers);
struct mailbox_transaction_context *_t,
struct mailbox_header_lookup_ctx *_wanted_headers);
enum mail_fetch_field fields,
struct mailbox_header_lookup_ctx *headers);
struct mailbox_header_lookup_ctx *headers)
ATTR_NULL(2);
struct message_header_line *hdr,
struct mailbox_header_lookup_ctx *headers,
const char *reason)
ATTR_NULL(2);
bool decode_to_utf8, const char **value_r);
bool decode_to_utf8, const char *const **value_r);
struct mailbox_header_lookup_ctx *headers,
const ARRAY_TYPE(keyword_indexes) *
struct message_size *hdr_size,
struct message_size *body_size,
const struct message_part *part,
unsigned int *body_lines_r, bool *binary_r,
const char **value_r);
enum mail_flags flags);
struct mail_keywords *keywords);
enum mail_fetch_field field,
const char *reason);
const char **value_r);
bool success);
unsigned int field_idx);
#endif