[sieve] Date and Index Extensions: return false instead of SIEVE_FAIL

From [RFC5260] Section 4. Date Test
   The date test returns false unconditionally if the specified header
   field does not exist, the field exists but does not contain a
   syntactically valid date-time specification, the date-time isn't
   valid according to the rules of the calendar system (e.g., January
   32nd, February 29 in a non-leap year), or the resulting string fails
   to match any key-list value.

Section 6. Index Extension does not specify what to do if the specific
occurrence of the header field does not exist.  It makes sense to
return false in this case instead of SIEVE_FAIL.

SIEVE_FAIL cancels execution of the entire script, which causes the
message to fall back to the implicit keep.
Merge branch 'date-extension'
[cunit] cunit.pl: fix init of CU_SuiteInfo type for CUnit 2.1-3

The struct CU_SuiteInfo in CUnit has two new members.  This means we
need two extra NULLs in the initilization.

This should allow the proper code to be generated, based on what
autoconf detects
Merge branch 'CUnit_2.1-3'
[sieve] add imap4flags reference

added RFC 5232 to references in preparation of implementing "imap4flags"
sieve extension

Big changes will be the addition of:
- the "hasflag" test
- the ":flags" argument to "keep" and "fileinto"

Additionally, "mark" and "unmark" actions will be deprecated.
[sieve] add parser support for imap4flags

added parser support for:
- hasflag test
- :flags tagged argument to fileinto and keep

also added imap4flags to sieve_extensions in imapoptions

also enabled :copy support for KEEP action

Redefine copy to not allow an empty case to prevent grammar conflicts.
(Required defining rtags for redirect aciton.)
[sieve] add imap4flags awareness to sieve interpreter

add the following to the sieve interpreter:
- test whether imap4flags is 'require'd
[sieve] update bytecode to support imap4flags

add imap4flags support to bytecode, specifically:
- updated B_KEEP to support :copy and :flags
  - :copy support in KEEP had been previously overlooked
- updated B_FILEINTO to support :flags
- new BC_HASFLAG to support imap4flags hasflag test
[sieve] imap4flags support for bytecode generator

update bc_generate.c for imap4flags as follows:
- add hasflag test support to bc_test_generate()
  - based on header test
- add :copy and :flags support to KEEP
  - :copy is an integer; :flags is a stringlist
- add :flags support to FILEINTO
[sieve] imap4flags support for bytecode emitter

update bc_emit.c for imap4flags as follows:
- add hasflag test support to bc_test_emit()
  - based on header test
- add :copy and :flags support to KEEP
  - :copy is an integer; :flags is a stringlist
- add :flags support to FILEINTO
  - duplicated code that had been shared between FILEINTO and REDIRECT
[sieve] imap4flags support for bytecode decompiler

update sieved.c for imap4flags as follows:
- add hasflag test support to dump2_test()
- add :copy and :flags support to KEEP in dump2()
- add :flags support to FILEINTO in dump2()
[sieve] bc_emit.c: fix comment

Comments were backwards of what was actually happening.
Relation comes before comparator in the bytecode.
[sieve] only 'fileinto' once per folder (RFC 3028)

Make do_fileinto() consistent with do_keep() in that if the action is
requested a second time, simply disregard the second and subsequent
request.

RFC 3028 [SIEVE]:
2.10.3.  Message Uniqueness in a Mailbox

   Implementations SHOULD NOT deliver a message to the same folder more
   than once, even if a script explicitly asks for a message to be
   written to a mailbox twice.
[sieve] fileinto: ensure last flag list value wins (RFC 5232)

The naive way of eliminating duplicates resulted in the first
(rather than the last) flag list value winning.  A solution
is to move the action to the end of the action list, ensuring
the last flag list value wins.

RFC 5232 [imap4flags] Sec 3. Actions:
   Note that when keep/fileinto is used multiple times in a script and
   duplicate message elimination is performed (as described in Section
   2.10.3 of [SIEVE]), the last flag list value MUST win.

RFC 3028 [SIEVE]:
2.10.3.  Message Uniqueness in a Mailbox

   Implementations SHOULD NOT deliver a message to the same folder more
   than once, even if a script explicitly asks for a message to be
   written to a mailbox twice.
[sieve] keep: ensure last flag list value wins (RFC 5232)

The naive way of eliminating duplicates resulted in the first
(rather than the last) flag list value winning.  A solution
is to move the action to the end of the action list, ensuring
the last flag list value wins.

This change has been copied from do_fileinto() to do_keep()

RFC 5232 [imap4flags] Sec 3. Actions:
   Note that when keep/fileinto is used multiple times in a script and
   duplicate message elimination is performed (as described in Section
   2.10.3 of [SIEVE]), the last flag list value MUST win.

RFC 3028 [SIEVE]:
2.10.3.  Message Uniqueness in a Mailbox

   Implementations SHOULD NOT deliver a message to the same folder more
   than once, even if a script explicitly asks for a message to be
   written to a mailbox twice.
[sieve] bc_generate,bc_emit: put new parameter first

makes it easier to keep backwards compatibility with older
bytecode versions
[sieve] message.c: add :copy support to keep action
[sieve] make sieve_{add,remove}flag() functions case insensitive
[sieve] bc_eval.c: support for :flags parameter on KEEP and FILEINTO

The actionflags parameter holds the value that was given in :flags
[sieve] bc_emit.c: add comments for B_FILEINTO

make sure the order of parameters is well-defined