diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-10-15 14:30:40 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-10-15 14:41:39 +0300 |
commit | 5e5b68fd028495f7076a576df26962bbdf51ac63 (patch) | |
tree | f1298cce376344cbfc67de3e0b9baf8d7f459fd0 /testsuite | |
parent | e759db27d650197ed1d8f837f30a2d03dcc23b4a (diff) | |
download | mailutils-5e5b68fd028495f7076a576df26962bbdf51ac63.tar.gz mailutils-5e5b68fd028495f7076a576df26962bbdf51ac63.tar.bz2 |
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.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/lib/mailutils.exp | 2 | ||||
-rw-r--r-- | testsuite/spool/DISTFILES | 1 | ||||
-rw-r--r-- | testsuite/spool/search.mbox | 113 |
3 files changed, 115 insertions, 1 deletions
diff --git a/testsuite/lib/mailutils.exp b/testsuite/lib/mailutils.exp index 3a18cbda6..004211697 100644 --- a/testsuite/lib/mailutils.exp +++ b/testsuite/lib/mailutils.exp @@ -45,7 +45,7 @@ proc mu_copy_file {src dst} { set output [open $dst w] set arg "$" for {gets $input line} {![eof $input]} {gets $input line} { - puts $output [subst -nobackslashes $line] + puts $output [subst -nobackslashes -nocommands $line] } close $input close $output diff --git a/testsuite/spool/DISTFILES b/testsuite/spool/DISTFILES index ccb51c409..59bb01e40 100644 --- a/testsuite/spool/DISTFILES +++ b/testsuite/spool/DISTFILES @@ -1,6 +1,7 @@ bigto.mbox mbox1 mbox +search.mbox sieve.mbox relational.mbox teaparty.mbox diff --git a/testsuite/spool/search.mbox b/testsuite/spool/search.mbox new file mode 100644 index 000000000..dd4f238be --- /dev/null +++ b/testsuite/spool/search.mbox @@ -0,0 +1,113 @@ +From lexi@example.net Mon Jul 29 22:00:08 2002 +Received: (from lexi@example.com) + by example.org id 3301 + for editor@example.org; Mon, 29 Jul 2002 22:00:06 +0100 +Date: Mon, 29 Jul 2002 22:00:01 +0100 +From: Lexicographer <lexi@example.com> +To: Editor <editor@example.org> +Subject: Abasement +Status: OR + +ABASEMENT, n. A decent and customary mental attitude in the presence +of wealth of power. Peculiarly appropriate in an employee when +addressing an employer. + +From correct@example.net Tue Jul 30 00:00:00 2002 +Received: (from correct@example.com) + by example.org id 3302 + for editor@example.org Tue, Jul 30 00:00:00 2002 +0100 +Date: Mon, 29 Jul 2002 22:00:02 +0100 +From: Corrector <correct@example.com> +To: Editor <editor@example.org> +Subject: Aboriginies +Status: ORA + +ABORIGINIES, n. Persons of little worth found cumbering the soil of a +newly discovered country. They soon cease to cumber; they fertilize. + +From lexi@example.net Tue Jul 30 12:00:10 2002 +Received: (from lexi@example.com) + by example.org id 3303 + for editor@example.org Tue, 30 Jul 2002 12:00:08 +0100 +Date: Tue, 30 Jul 2002 12:00:03 +0100 +From: Lexicographer <lexi@example.com> +To: Editor <editor@example.org> +Message-Id: "<200207291200.3303@example.org>" +Subject: Abnormal +Status: ORA + +ABNORMAL, adj. Not conforming to standard. In matters of thought and +conduct, to be independent is to be abnormal, to be abnormal is to be +detested. Wherefore the lexicographer adviseth a striving toward the +straiter [sic] resemblance of the Average Man than he hath to himself. +Whoso attaineth thereto shall have peace, the prospect of death and +the hope of Hell. + +From corrector@example.net Tue Jul 30 12:00:11 2002 +Received: (from correct@example.com) + by example.org id 3304 + for editor@example.org Tue, 30 Jul 2002 12:00:09 +0100 +Date: Tue, 30 Jul 2002 12:00:04 +0100 +From: Corrector <corrector@example.com> +To: Editor <editor@example.org> +Subject: Occident + +OCCIDENT, n. The part of the world lying west (or east) of the +Orient. It is largely inhabited by Christians, a powerful subtribe of +the Hypocrites, whose principal industries are murder and cheating, +which they are pleased to call "war" and "commerce." These, also, are +the principal industries of the Orient. + +From lexi@example.net Wed Jul 31 02:00:12 2002 +Received: (from lexi@example.com) + by example.org id 3305 + for corrector@example.org Wed, 31 Jul 2002 02:00:10 +0100 +Date: Wed, 31 Jul 2002 02:00:05 +0100 +From: Lexicographer <lexi@example.com> +To: Corrector <correct@example.org> +Subject: Acquaintance + +ACQUAINTANCE, n. A person whom we know well enough to borrow from, +but not well enough to lend to. A degree of friendship called slight +when its object is poor or obscure, and intimate when he is rich or +famous. + +From lexi@example.net Thu Aug 01 10:00:13 2002 +Received: (from lexi@example.com) + by example.org id 3306 + for editor@example.org Thu, 01 Aug 2002 10:00:11 +0100 +Date: Thu, 01 Aug 2002 22:00:06 +0100 +From: Lexicographer <lexi@example.com> +To: Editor <editor@example.org> +Cc: Corrector <correct@example.org> +Subject: Alliance + +ALLIANCE, n. In international politics, the union of two thieves who +have their hands so deeply inserted in each other's pockets that they +cannot separately plunder a third. + +From lexi@example.net Fri Aug 02 11:00:14 2002 +Received: (from lexi@example.com) + by example.org id 3307 + for editor@example.org Fri, 02 Aug 2002 11:00:12 +0100 +Date: Fri, 02 Aug 2002 11:00:07 +0100 +From: Lexicographer <lexi@example.com> +To: Editor <editor+recheck@example.org> +Subject: White + +WHITE, adj. and n. Black. + +From correct@example.net Fri Aug 02 12:00:15 2002 +Received: (from correct@example.com) + by example.org id 3308 + for editor@example.org Fri, 02 Aug 2002 12:00:13 +0100 +Date: Fri, 02 Aug 2002 12:00:08 +0100 +From: Corrector <correct@example.com> +To: Editor <editor@example.org> +Subject: Telephone + +TELEPHONE, n. An invention of the devil which abrogates some of the +advantages of making a disagreeable person keep his distance. + + + |