index-mail.h revision 0d86aa0d47f7393c669c084b34c0537b193688ad
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainen /* fixed size fields */
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainen /* variable sized field */
31be5ed1551c98cddeb2295a594f010aaf4b76bcTimo Sirainen global_cache_fields[MAIL_INDEX_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;
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);
73b50eecfc31750a312e2f940023f522eb07178cTimo Sirainenvoid index_mail_set_seq(struct mail *mail, uint32_t seq);
73b50eecfc31750a312e2f940023f522eb07178cTimo Sirainenbool index_mail_set_uid(struct mail *mail, uint32_t uid);
77af0bd168cf3e3ddc3ae68abc82bfad7e9b5ff4Timo Sirainenbool index_mail_want_parse_headers(struct index_mail *mail);
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,
83bb013a99f0936995f9c7a1077822662d8fefdbTimo Sirainenint index_mail_headers_get_envelope(struct index_mail *mail);
83bb013a99f0936995f9c7a1077822662d8fefdbTimo Sirainenint index_mail_get_first_header(struct mail *_mail, const char *field,
83bb013a99f0936995f9c7a1077822662d8fefdbTimo Sirainenint index_mail_get_headers(struct mail *_mail, const char *field,
83bb013a99f0936995f9c7a1077822662d8fefdbTimo Sirainen bool decode_to_utf8, const char *const **value_r);
83bb013a99f0936995f9c7a1077822662d8fefdbTimo Sirainenint index_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);
83bb013a99f0936995f9c7a1077822662d8fefdbTimo Sirainenint index_mail_get_received_date(struct mail *_mail, time_t *date_r);
83bb013a99f0936995f9c7a1077822662d8fefdbTimo Sirainenint index_mail_get_save_date(struct mail *_mail, time_t *date_r);
83bb013a99f0936995f9c7a1077822662d8fefdbTimo Sirainenint index_mail_get_date(struct mail *_mail, time_t *date_r, int *timezone_r);
83bb013a99f0936995f9c7a1077822662d8fefdbTimo Sirainenint index_mail_get_virtual_size(struct mail *mail, uoff_t *size_r);
83bb013a99f0936995f9c7a1077822662d8fefdbTimo Sirainenint index_mail_get_physical_size(struct mail *mail, uoff_t *size_r);
83bb013a99f0936995f9c7a1077822662d8fefdbTimo Sirainenint index_mail_init_stream(struct index_mail *mail,
83bb013a99f0936995f9c7a1077822662d8fefdbTimo Sirainenint index_mail_get_special(struct mail *_mail, enum mail_fetch_field field,
83bb013a99f0936995f9c7a1077822662d8fefdbTimo Sirainen const char **value_r);
73b50eecfc31750a312e2f940023f522eb07178cTimo Sirainenvoid index_mail_update_flags(struct mail *mail, enum modify_type modify_type,
73b50eecfc31750a312e2f940023f522eb07178cTimo Sirainenvoid index_mail_update_keywords(struct mail *mail, enum modify_type modify_type,
83bb013a99f0936995f9c7a1077822662d8fefdbTimo Sirainenbool index_mail_get_cached_uoff_t(struct index_mail *mail,
83bb013a99f0936995f9c7a1077822662d8fefdbTimo Sirainen enum index_cache_field field, uoff_t *size_r);
83bb013a99f0936995f9c7a1077822662d8fefdbTimo Sirainenbool 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,
e54512a5189192fe72d1e2c53927c98c5ac920b4Timo Sirainenstruct istream *index_mail_cache_parse_init(struct mail *mail,
2ebeb22b9a8a8bb7fbe2f2e2908478a220792b87Timo Sirainenvoid index_mail_cache_parse_continue(struct mail *mail);