Improve the append message to mailbox in IMAP server.

Add support for set the appending message's flag.
Add support for APPENDUID command (RFC 4315)
Merge branch 'refs/heads/appenduid_support' into private_branch