diff options
-rw-r--r-- | libproto/imap/fetch.c | 8 | ||||
-rw-r--r-- | libproto/imap/mailbox.c | 2 | ||||
-rw-r--r-- | libproto/mbox/mboxrd.c | 8 |
3 files changed, 14 insertions, 4 deletions
diff --git a/libproto/imap/fetch.c b/libproto/imap/fetch.c index e9020c55d..ad1f849bb 100644 --- a/libproto/imap/fetch.c +++ b/libproto/imap/fetch.c @@ -870,9 +870,7 @@ _fill_response (void *item, void *data) switch (env->n++) { case env_date: - if (elt->type != imap_eltype_string) - rc = MU_ERR_FAILURE; - else + if (elt->type == imap_eltype_string) { if (mu_scan_datetime (elt->v.string, MU_DATETIME_SCAN_RFC822, @@ -882,6 +880,10 @@ _fill_response (void *item, void *data) else rc = 0; } + else if (_mu_imap_list_element_is_nil (elt)) + rc = 0; + else + rc = MU_ERR_FAILURE; break; case env_subject: diff --git a/libproto/imap/mailbox.c b/libproto/imap/mailbox.c index 733fc8c4b..529fadf24 100644 --- a/libproto/imap/mailbox.c +++ b/libproto/imap/mailbox.c @@ -174,7 +174,7 @@ __imap_msg_get_stream (struct _mu_imap_message *imsg, size_t msgno, mu_stream_set_buffer (imbx->cache, mu_buffer_full, 8192); } - rc = mu_stream_size (imbx->cache, &imsg->offset); + rc = mu_stream_seek (imbx->cache, 0, MU_SEEK_END, &imsg->offset); if (rc) return rc; diff --git a/libproto/mbox/mboxrd.c b/libproto/mbox/mboxrd.c index 6357bbbc7..43c370dc9 100644 --- a/libproto/mbox/mboxrd.c +++ b/libproto/mbox/mboxrd.c @@ -1141,6 +1141,14 @@ mailbox_append_message (mu_mailbox_t mailbox, mu_message_t msg) if (rc == 0) { rc = mu_envelope_aget_date (env, &date); + if (rc == MU_ERR_NOENT) + { + date = strdup ("Thu Jan 1 00:00:00 1970"); + if (date) + rc = 0; + else + rc = ENOMEM; + } } mu_envelope_destroy (&env, msg); |