[IRIS-1109] Multiple folders for GETMETADATA

Add a Cyrus-specific nonstandard extension of the GETMETADATA syntax
which allows multiple folder names to be specified in (parentheses)
instead of a single folder.  The folder names are not treated as
wildcards.

To support this, renamed annotate_apply_mailboxes() to
annotate_apply_mailbox_pattern() and add annotate_apply_mailbox_array()
which takes a strarray_t of mbox names.
mboxlist_delayed_deletemailbox: remove unused arg
mailbox - noisier error on rewrite failure
cyr_expire: open annotations database

This allows per-message annotations to be cleaned up
Small cleanup in run_startup().
master: enforce -d/-D in one place

These two options are mutually incompatible.  Do the compatibility
checks in only one place.
master: whitespace & indentation fixes
master: remove duplicate syslog()s
master: sensible types for event.{hour,min}

int not time_t.
Remove sieve action string

We use sieve to forward messages to a notification
daemon which can send SMSes, and we don't want them
filled with information about the actions which
Sieve took.

This patch stops the action_string being appended to
the message sent to the notify daemon.
GUID IMAP COMMANDS

This patch factors out stuff we used to have in the old MD5UUIDs
patch, the following FETCH responses in imapd:

FETCH DIGEST.SHA1 => 40 character hex string (message sha1)
FETCH RFC822.SHA1 => 40 character hex string (message sha1, calculated)
FETCH RFC822.FILESIZE => size of actual file on disk (via stat or mmap)

It also adds a capability string item: "DIGEST=SHA1"

Totally non-standard of course, but way useful for our replication checking
scripts.  Embrace and extend 'r' us.

Anyone feel like writing an RFC for fetching the digest of a message via
IMAP?  If the server calculated it on delivery and cached it then you'd have
a great way to clean up after a UIDVALIDITY change or other destabilising event
without having to fetch every message again.
Tool to build debian package directory
actually, just not git
Fatal -> abort in common daemons
Fastmail Secrets (no rated)
Add conversations database.

It's a very simple database with only one type of record, which
maps a message-id with angle brackets, e.g. "<0001@example.com>",
to a conversation id and a timestamp.  The conversation id is a
64b int.

struct conversations_state holds a reference to an open conversations
database.  There can be more than one of these in existance.  There
will eventually be a conversations databases per-user, but this code
doesn't know that and just takes a filename.

conversations_open() opens a database handle and starts a transaction.

conversations_close() aborts the transation if it has not been
    commited, and closes the database handle.

conversations_commit() commits a transaction.

conversations_set() stores a conversation id for a msgid, and sets
    the record's timestamp to the current system time.

conversations_get() retrieves the conversation id given a msgid.

conversations_prune() removes all records older than a given time.

Merge summary:

    merged in "Add conversations_getpath()"
    merged in some hunks of "Add conversationsdump utility."
    merged in some hunks of "Add an imap option to enable conversations"
    merged in some hunks of "Add conversation_id_{de,en}code()"
    merged in some hunks of "Fix compile warnings in conversations code."
    merged in "More fixup for conversion to times.c in imapurl.c"
    merged in some hunks of "conversations_prune() returns statistics"
    merged in some hunks of "Rename conversations_{get,set} -> _{get,set}_cid"
    merged in "Add conversations_add_folder()"
    merged in "Add conversations_rename_cid()"
    merged in "Dump and undump API for conversations."
    merged in some hunks of "conversations: convert to human readable DB format"
    merged in "conversations: use mboxname_conf_getpath"
    merged in some hunks of "add highestmodseq to conversations db"
    merged in some hunks of "conversations: rename get/set_cid to get/set_msgid for clarity"
    merged in "conversations: remove bogus buffer"
    merged in some hunks of "convert conversations to use dlist and support status data, part 1"
    merged in some hunks of "conversations_pass a mailbox object down, ouch"
    merged in "cleanups"
    merged in "remove UNSEEN from perl-folder, we don't care"
    merged in some hunks of "Fix recent conversations API maldesign"
    merged in "Stuff"
    merged in "conversations: don't go segfaulting if starting from scratch"
    merged in "conversations: simplify accounting"
    merged in "conversations: don't fail if cid == 0"
    merged in some hunks of "Some more conversations API rejigging"
    merged in some hunks of "conversations: add sender support"
    merged in "conversations: status API"
    merged in "conversations: gnb review - don't leak keys"
    merged in "conversations: gnb review - sender handling safety"
    merged in "conversations: gnb review - free sender information"
    merged in "conversations: return empty for corrupted data"
    merged in "conversations: don't let counts go negative"
    merged in some hunks of "conversation: add flagged and stub for attachments"
    merged in "conversations: add version information to the front of every record"
    merged in some hunks of "conversation: change "SENDER" format to be the same as ENVELOPE"
    merged in "conversations: fix route fail"
    merged in "conversations: don't delete zero-exists conversations"
    merged in "IRIS 242 - fix XCONVUNSEEN counting"
    merged in "remove debugging line"
    merged in some hunks of "conversations: use cstate from the mailbox for rename callback"
    merged in "conversations: make "NAME" optional in email addresses"
    merged in some hunks of "Fix recent regressions in CID renaming."
    merged in some hunks from "conversations: add XCONVMODSEQ status item to folders"
    merged in "conversations: allow specifying only some fields to getstatus"
    merged in "make conversation_free NULL-safe"
    merged in some hunks of "first rewrite of conversations open and close"
    merged in some hunks of "ctl_converstationsdb - add '-R' option"
    merged in "ctl_conversationsdb cleanup"
    merged in "conversations: fix remove (found by unit tests)"
    merged in "conversations_rename_folder API first draft"
    merged in some hunks of "conversations_rename_folder part 2 - use it."
    merged in some hunks of "conversations_rename_folder: use NULL to_name for delete"
    merged in "remove the 'exists' count for the being-deleted mailbox as well."
    merged in some lines of "Fix parallel build."
    merged in "conversations: fix memory leak"
    merged in some hunks of "conversations: counts per flag (including to-backport dlist usage fixes)"
    merged in some hunks of "gnb review: convert to strarray_t * and clean up"
    merged in "options: document conversations_counted_flags better"
    merged in some hunks of "conversations: remove limit on the number of counted_flags"
    merged in some hunks of "conversations: store counted flags in the DB"
    merged in "conversations: re-init counted flags on a wipe"
    merged in "Fix memleak of conversation_t.counts"
    plus manual cleanups
mboxname: add nextmodseq and nextuidvalidity APIs

Merge summary:

    merged in "mboxname: initialise fd"
    merged in "use per-user meta files to serialize uidvalidity and highestmodseq"
    merged in "only use per-user modseq and uidvalidity if conversations are enabled"
    merged in "managed values: add set API and use in replication"
    merged in "mboxname_setval: make sync_server value setting work correctly"
    merged in "sync: handle highestmodseq correctly on mailbox create"
    merged in "cunit: test mboxname_nextmodseq (currently broken)"
    merged in "Fix the mboxname.nextmodseq test."
    merged in "unit: add config handling in mboxname tests"
Add unit test for conversations db.

Merge summary:

    merged in "unit: test conversation_id_encode et al"
    merged in some hunks of "conversations_prune() returns statistics"
    merged in some hunks of "Rename conversations_{get,set} -> _{get,set}_cid"
    merged in "unit: test conversations_add_folder()"
    merged in "unit: test conversations_rename_cid()"
    merged in "unit: test conversations dump API"
    merged in some hunks of "add highestmodseq to conversations db"
    merged in some hunks of "convert conversations to use dlist and support status data, part 1"
    merged in "unit: remove stray printf."
    merged in "cunit: re-enable slow "prune" test"
    merged in some hunks of "Fix recent conversations API maldesign"
    merged in some hunks of "Some more conversations API rejigging"
    merged in some hunks of "unit: update conversation:cid_rename"
    merged in "unit: track conversations_update() changes"
    merged in "unit: track changes to conversations_rename_cid()"
    merged in "cunit: make test work with new conversations API"
    merged in "cunit: test conversations_folder_rename"
    merged in "unit: fix compile warnings"
    merged in "unit: test counted flags"
    merged in "cunit: support counted_flags in DB"
    merged in "unit: fix memleak in conversations tests"
Add mailbox actions file.

This is a file where actions can be posted, that are then later executed
by the first process to open the mailbox with an exclusive lock.  A
fcntl lock is used to provide exclusion between writers to file file,
and to detect when a writer has lost a race with an opener (who renames
the actions file before excuting the actions therein).  Actions are
simple lines of text.

Currently only a single action is implemented, the NOP action which just
increments a count.  This is for testing purposes.

The purpose of the mechanism is to allow delayed renaming of CIDs in
mailbox index files.

Merge summary:

    manually tweaked to add #include "strarray.h"
unit: test mailbox actions posting

Merge summary:

    merged in "mailbox: update unit tests"
    merged in "unit: use config_reset()"