imap4d: fix returned INTERNALDATE and date searches.
INTERNALDATE now includes a meaningful timezone information (it used to return +0000). Date searches disregard the time and timezone of the INTERNALDATE or Date: header, as mandated by RFC 3501. * libmailutils/base/date.c (mu_parse_ctime_date_time): In the absence of TZ in ctime strings, return local time zone. * imap4d/io.c (imap4d_tokbuf_getline): Kill trailing whitespace. * imap4d/util.c (adjust_tm): New function. (util_parse_internal_date) (util_parse_822_date) (util_parse_ctime_date): Take three arguments, the third one controlling what information to return. All uses updated. * imap4d/fetch.c (_frt_internaldate): Return meaningful timezone. If all else fails, use local TZ. * imap4d/imap4d.h (datetime_parse_mode): New enum. (util_parse_internal_date) (util_parse_822_date) (util_parse_ctime_date): Change signature. * imap4d/search.c (parse_simple_key) (_header_date,cond_before,cond_on,cond_since): Use datetime_date_only mode. * testsuite/spool/search.mbox: New file. * testsuite/spool/DISTFILES: Add search.mbox * imap4d/testsuite/lib/imap4d.exp (imap4d_start): New option -mbox. * imap4d/testsuite/imap4d/search.exp: Rewrite. * imap4d/testsuite/imap4d/create.exp: Account for TZ part in internaldate strings, which may vary. * imap4d/testsuite/imap4d/fetch.exp: Likewise. * imap4d/testsuite/imap4d/list.exp: List the new mailbox.
Showing
15 changed files
with
267 additions
and
84 deletions
testsuite/spool/search.mbox
0 → 100644
-
Please register or sign in to post a comment