~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/lib-storage/index/pop3c/pop3c-mail.c

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2011-2012 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2011-2013 Dovecot authors, see the included COPYING file */
2
2
 
3
3
#include "lib.h"
4
4
#include "istream.h"
9
9
 
10
10
static int pop3c_mail_get_received_date(struct mail *_mail, time_t *date_r)
11
11
{
12
 
        mail_storage_set_error(_mail->box->storage, MAIL_ERROR_NOTPOSSIBLE,
13
 
                               "POP3 has no received date");
14
 
        *date_r = (time_t)-1;
15
 
        return -1;
 
12
        int tz;
 
13
 
 
14
        /* FIXME: we could also parse the first Received: header and get
 
15
           the date from there, but since this code is unlikely to be called
 
16
           except during migration, I don't think it really matters. */
 
17
        return index_mail_get_date(_mail, date_r, &tz);
16
18
}
17
19
 
18
20
static int pop3c_mail_get_save_date(struct mail *_mail, time_t *date_r)
19
21
{
20
 
        mail_storage_set_error(_mail->box->storage, MAIL_ERROR_NOTPOSSIBLE,
21
 
                               "POP3 has no save date");
22
 
        *date_r = (time_t)-1;
23
 
        return -1;
 
22
        struct index_mail *mail = (struct index_mail *)_mail;
 
23
        struct index_mail_data *data = &mail->data;
 
24
 
 
25
        if (data->save_date == (time_t)-1) {
 
26
                /* FIXME: we could use a value stored in cache */
 
27
                return pop3c_mail_get_received_date(_mail, date_r);
 
28
        }
 
29
        *date_r = data->save_date;
 
30
        return 0;
24
31
}
25
32
 
26
33
static int pop3c_mail_get_physical_size(struct mail *_mail, uoff_t *size_r)
172
179
        index_mail_get_keywords,
173
180
        index_mail_get_keyword_indexes,
174
181
        index_mail_get_modseq,
 
182
        index_mail_get_pvt_modseq,
175
183
        index_mail_get_parts,
176
184
        index_mail_get_date,
177
185
        pop3c_mail_get_received_date,
182
190
        index_mail_get_headers,
183
191
        index_mail_get_header_stream,
184
192
        pop3c_mail_get_stream,
 
193
        index_mail_get_binary_stream,
185
194
        pop3c_mail_get_special,
186
195
        index_mail_get_real_mail,
187
196
        index_mail_update_flags,
188
197
        index_mail_update_keywords,
189
198
        index_mail_update_modseq,
 
199
        index_mail_update_pvt_modseq,
190
200
        NULL,
191
201
        index_mail_expunge,
192
202
        index_mail_set_cache_corrupted,