index-mail.h revision 5cda0bfea032000c4a51134c748d9efe6614870b
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainen /* fixed size fields */
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainen /* variable sized field */
bcd8a160ce32e5afe3566793b5a144028063b2fbTimo Sirainenextern struct mail_cache_field global_cache_fields[MAIL_CACHE_FIELD_COUNT];
1b4441e3e6f9e78ebeae8218de971959cd55bf60Timo Sirainen "\"text\" \"plain\" (\"charset\" \"us-ascii\") NIL NIL \"7bit\""
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainen /* If binary flags are set, it's not checked whether mail is
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainen missing CRs. So this flag may be set as an optimization for
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainen regular non-binary mails as well if it's known that it contains
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainen valid CR+LF line breaks. */
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainen /* Mail header or body is known to contain NUL characters. */
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainen /* Mail header or body is known to not contain NUL characters. */
1b4441e3e6f9e78ebeae8218de971959cd55bf60Timo Sirainen /* BODY is IMAP_BODY_PLAIN_7BIT_ASCII and rest of BODYSTRUCTURE
1b4441e3e6f9e78ebeae8218de971959cd55bf60Timo Sirainen fields are NIL */
1b4441e3e6f9e78ebeae8218de971959cd55bf60Timo Sirainen MAIL_CACHE_FLAG_TEXT_PLAIN_7BIT_ASCII = 0x0010
33d63688ed8b26dc333e3c2edbfb2fe6e412604dTimo Sirainen const char *envelope, *body, *bodystructure, *uid_string;
645f258ea29afaf09b673fc65d1bd788dfec8db8Timo Sirainen struct message_part_envelope_data *envelope_data;
3af0a1a2c2ef22a14c6b3c5cc4f780a2ea4df438Timo Sirainen const struct mail_cache_field *all_cache_fields;
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainen struct index_header_lookup_ctx *wanted_headers;
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainen /* per-mail variables, here for performance reasons: */
8d80659e504ffb34bb0c6a633184fece35751b18Timo Sirainen ARRAY_DEFINE(header_lines, struct index_mail_line);
8d80659e504ffb34bb0c6a633184fece35751b18Timo Sirainen ARRAY_DEFINE(header_match_lines, unsigned int);
fdc557286bc9f92c5f3bb49096ff6e2bcec0ea79Timo Sirainenindex_mail_alloc(struct mailbox_transaction_context *t,
fdc557286bc9f92c5f3bb49096ff6e2bcec0ea79Timo Sirainen struct mailbox_header_lookup_ctx *wanted_headers);
fdc557286bc9f92c5f3bb49096ff6e2bcec0ea79Timo Sirainenint index_mail_set_seq(struct mail *mail, uint32_t seq);
a12399903f415a7e14c2816cffa2f7a09dcbb097Timo Sirainenint index_mail_set_uid(struct mail *mail, uint32_t uid);
6789ed17e7ca4021713507baf0dcf6979bb42e0cTimo Sirainenvoid index_mail_parse_header_init(struct index_mail *mail,
d2b94d25f842cd1b7acaf4dd7de858f7c6a821c9Timo Sirainenvoid index_mail_parse_header(struct message_part *part,
2aecf7be5834e7f6520f8deaad683a6fa1de4d61Timo Sirainenint index_mail_parse_headers(struct index_mail *mail,
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainenvoid index_mail_headers_get_envelope(struct index_mail *mail);
87460b08cb97b31cde640d4975a6aa2c1d0e7226Timo Sirainenconst char *index_mail_get_first_header(struct mail *_mail, const char *field);
87460b08cb97b31cde640d4975a6aa2c1d0e7226Timo Sirainenconst char *const *
87460b08cb97b31cde640d4975a6aa2c1d0e7226Timo Sirainenindex_mail_get_headers(struct mail *_mail, const char *field);
87460b08cb97b31cde640d4975a6aa2c1d0e7226Timo Sirainenindex_mail_get_header_stream(struct mail *_mail,
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainenenum mail_flags index_mail_get_flags(struct mail *_mail);
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainenconst char *const *index_mail_get_keywords(struct mail *_mail);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenconst struct message_part *index_mail_get_parts(struct mail *_mail);
8fcff4c5b52f24d9c681805fdf06b486f1d0fcbeTimo Sirainentime_t index_mail_get_received_date(struct mail *_mail);
90adcaa0a00eba29b7fbd50ca66be11c8d086d6aTimo Sirainentime_t index_mail_get_save_date(struct mail *_mail);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainentime_t index_mail_get_date(struct mail *_mail, int *timezone);
d67fde1a8ebc1d85704c5986d8f93aae97eccef3Timo Sirainenuoff_t index_mail_get_virtual_size(struct mail *mail);
d67fde1a8ebc1d85704c5986d8f93aae97eccef3Timo Sirainenuoff_t index_mail_get_physical_size(struct mail *mail);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenstruct istream *index_mail_init_stream(struct index_mail *mail,
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenconst char *index_mail_get_special(struct mail *_mail,
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainenint index_mail_update_flags(struct mail *mail, enum modify_type modify_type,
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainenint index_mail_update_keywords(struct mail *mail, enum modify_type modify_type,
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenuoff_t index_mail_get_cached_uoff_t(struct index_mail *mail,
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenuoff_t index_mail_get_cached_virtual_size(struct index_mail *mail);
5cda0bfea032000c4a51134c748d9efe6614870bTimo Sirainenvoid index_mail_cache_add(struct index_mail *mail, enum index_cache_field field,
5cda0bfea032000c4a51134c748d9efe6614870bTimo Sirainenvoid index_mail_cache_add_idx(struct index_mail *mail, unsigned int field_idx,
2ebeb22b9a8a8bb7fbe2f2e2908478a220792b87Timo Sirainenvoid index_mail_cache_parse_init(struct mail *mail, struct istream *input);
2ebeb22b9a8a8bb7fbe2f2e2908478a220792b87Timo Sirainenvoid index_mail_cache_parse_continue(struct mail *mail);