mbox-mail.c revision 01cbf4ac5d44137ab434791be7f838d98d0fcf3b
89a126810703c666309310d0f3189e9834d70b5bTimo Sirainen/* Copyright (C) 2003 Timo Sirainen */
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenstatic int mbox_mail_seek(struct index_mail *mail)
3ddbbe03fe74b3ee7b1dff4e08ec706d7880d052Timo Sirainen if (mail_index_lookup_extra(ibox->view, mail->mail.seq,
6789ed17e7ca4021713507baf0dcf6979bb42e0cTimo Sirainen // FIXME: lock the file. sync if needed.
6789ed17e7ca4021713507baf0dcf6979bb42e0cTimo Sirainen istream_raw_mbox_seek(ibox->mbox_stream, *((const uint64_t *)data));
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainenstatic const struct mail_full_flags *mbox_mail_get_flags(struct mail *_mail)
4b058f90f9e8a2c6b2eed275de4eb8cc5195a71dTimo Sirainen /*FIXME:struct index_mail *mail = (struct index_mail *)_mail;
4b058f90f9e8a2c6b2eed275de4eb8cc5195a71dTimo Sirainen struct index_mail_data *data = &mail->data;
6789ed17e7ca4021713507baf0dcf6979bb42e0cTimo Sirainen i_assert(_mail->seq <= mail->ibox->mbox_data_count);
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainen (void)index_mail_get_flags(_mail);
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainen if ((mail->ibox->mbox_data[_mail->seq-1] & 1) != 0)
6789ed17e7ca4021713507baf0dcf6979bb42e0cTimo Sirainen data->flags.flags |= MAIL_RECENT;
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainen return &data->flags;*/
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainenstatic time_t mbox_mail_get_received_date(struct mail *_mail)
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainen struct index_mail *mail = (struct index_mail *)_mail;
5ce2084ada06ade9f44fc2914c34658e9a842dc1Timo Sirainen istream_raw_mbox_get_received_time(mail->ibox->mbox_stream);
f1e9611e93dcb3b745c1904029084fa81644e1b3Timo Sirainen index_mail_cache_add(mail, MAIL_CACHE_RECEIVED_DATE,
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainenstatic const char *
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainenmbox_mail_get_special(struct mail *_mail, enum mail_fetch_field field)
e60a349c641bb2f4723e4a395a25f55531682d2bTimo Sirainen struct index_mail *mail = (struct index_mail *)_mail;
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainen return istream_raw_mbox_get_sender(mail->ibox->mbox_stream);
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainenstatic struct istream *mbox_mail_get_stream(struct mail *_mail,
5ce2084ada06ade9f44fc2914c34658e9a842dc1Timo Sirainen struct index_mail *mail = (struct index_mail *)_mail;
91dca97b367c54a139c268b56a0c67f564bd9197Timo Sirainen // FIXME: need to hide the headers
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainen (void)i_stream_read(raw_stream); /* fix v_offset */
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainen data->stream = i_stream_create_limit(default_pool,
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainen return index_mail_init_stream(mail, hdr_size, body_size);
88ea893b45d3ed8d68000921db9156c03cbe1b00Timo Sirainen 0, 0, 0, 0, 0, 0,