Lines Matching refs:mail
6 #include "index-mail.h"
11 struct mail *
16 struct pop3c_mail *mail;
19 pool = pool_alloconly_create("mail", 2048);
20 mail = p_new(pool, struct pop3c_mail, 1);
21 mail->imail.mail.pool = pool;
23 index_mail_init(&mail->imail, t, wanted_fields, wanted_headers);
24 return &mail->imail.mail.mail;
27 static void pop3c_mail_close(struct mail *_mail)
32 /* wait for any prefetch to finish before closing the mail */
39 static int pop3c_mail_get_received_date(struct mail *_mail, time_t *date_r)
56 static int pop3c_mail_get_save_date(struct mail *_mail, time_t *date_r)
58 struct index_mail *mail = INDEX_MAIL(_mail);
59 struct index_mail_data *data = &mail->data;
69 static int pop3c_mail_get_physical_size(struct mail *_mail, uoff_t *size_r)
71 struct index_mail *mail = INDEX_MAIL(_mail);
76 if (mail->data.virtual_size != (uoff_t)-1) {
79 *size_r = mail->data.virtual_size;
83 *size_r = mail->data.physical_size;
105 i_assert(mail->data.physical_size != (uoff_t)-1);
106 *size_r = mail->data.physical_size;
110 static void pop3c_mail_cache_size(struct index_mail *mail)
114 if (i_stream_get_size(mail->data.stream, TRUE, &size) <= 0)
116 mail->data.virtual_size = size;
117 /* it'll be actually added to index when closing the mail in
140 static bool pop3c_mail_prefetch(struct mail *_mail)
168 pop3c_mail_get_stream(struct mail *_mail, bool get_body,
173 struct index_mail *mail = &pmail->imail;
180 if ((mail->data.access_part & (READ_BODY | PARSE_BODY)) != 0)
188 if (pmail->prefetch_stream != NULL && mail->data.stream == NULL) {
189 mail->data.stream = pmail->prefetch_stream;
194 if (get_body && mail->data.stream != NULL) {
195 name = i_stream_get_name(mail->data.stream);
201 index_mail_close_streams(mail);
207 if (mail->data.stream == NULL) {
222 mail->data.stream = input;
223 i_stream_set_name(mail->data.stream, t_strcut(cmd, '\r'));
227 if (mail->mail.v.istream_opened != NULL) {
228 if (mail->mail.v.istream_opened(_mail,
229 &mail->data.stream) < 0) {
230 index_mail_close_streams(mail);
235 pop3c_mail_cache_size(mail);
239 mail->data.stream->blocking = TRUE;
240 return index_mail_init_stream(mail, hdr_size, body_size, stream_r);
244 pop3c_mail_get_special(struct mail *_mail, enum mail_fetch_field field,