bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2007-2018 Dovecot authors, see the included COPYING file */
8af1a286fb27446eeb0e7a8764cd3ed8d35ff2acJosef 'Jeff' Sipek struct raw_mailbox *mbox = RAW_MAILBOX(mail->box);
e34d170f8f0e084bd94bfbc1a7085ece67e508dfTimo Sirainen if (mail->lookup_abort == MAIL_LOOKUP_ABORT_NOT_IN_CACHE) {
2d01cc1880cf2afd4fb1c8ad7fa6ce78e562e71eTimo Sirainen mail->transaction->stats.fstat_lookup_count++;
01f4ee4a0243f3fe9af763e1a540cd5cff0d63f5Timo Sirainen if (i_stream_stat(mail->box->input, TRUE, &st) < 0) {
d4002fe1f64d25a792f76fb102ef7dc519cd4e24Martti Rannanjärvi mail_set_critical(mail, "stat(%s) failed: %m",
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainenstatic int raw_mail_get_received_date(struct mail *_mail, time_t *date_r)
87490012895b4f371635ded00add04c9107dcfefJosef 'Jeff' Sipek struct index_mail *mail = INDEX_MAIL(_mail);
8af1a286fb27446eeb0e7a8764cd3ed8d35ff2acJosef 'Jeff' Sipek struct raw_mailbox *mbox = RAW_MAILBOX(_mail->box);
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen *date_r = mail->data.received_date = mbox->mtime;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainenstatic int raw_mail_get_save_date(struct mail *_mail, time_t *date_r)
87490012895b4f371635ded00add04c9107dcfefJosef 'Jeff' Sipek struct index_mail *mail = INDEX_MAIL(_mail);
8af1a286fb27446eeb0e7a8764cd3ed8d35ff2acJosef 'Jeff' Sipek struct raw_mailbox *mbox = RAW_MAILBOX(_mail->box);
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainenstatic int raw_mail_get_physical_size(struct mail *_mail, uoff_t *size_r)
87490012895b4f371635ded00add04c9107dcfefJosef 'Jeff' Sipek struct index_mail *mail = INDEX_MAIL(_mail);
8af1a286fb27446eeb0e7a8764cd3ed8d35ff2acJosef 'Jeff' Sipek struct raw_mailbox *mbox = RAW_MAILBOX(_mail->box);
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen *size_r = mail->data.physical_size = mbox->size;
6df0ab0c1ab91f06b6418cb30eff44405a1b8f02Timo Sirainenraw_mail_get_stream(struct mail *_mail, bool get_body ATTR_UNUSED,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen struct message_size *body_size, struct istream **stream_r)
87490012895b4f371635ded00add04c9107dcfefJosef 'Jeff' Sipek struct index_mail *mail = INDEX_MAIL(_mail);
ba7feb1cccc99ce1e8a03d35ca024192ea9233b1Timo Sirainen /* we can't just reference mbox->input, because
ba7feb1cccc99ce1e8a03d35ca024192ea9233b1Timo Sirainen index_mail_close() expects to be able to free the stream */
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen i_stream_create_limit(_mail->box->input, (uoff_t)-1);
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen return index_mail_init_stream(mail, hdr_size, body_size, stream_r);
8fa302c0c0f110aecf266d20673aae567bd77f3bTimo Sirainenraw_mail_get_special(struct mail *_mail, enum mail_fetch_field field,
8fa302c0c0f110aecf266d20673aae567bd77f3bTimo Sirainen const char **value_r)
8af1a286fb27446eeb0e7a8764cd3ed8d35ff2acJosef 'Jeff' Sipek struct raw_mailbox *mbox = RAW_MAILBOX(_mail->box);