imap client: implement CREATE and APPEND. Fix APPEND in imap4d.
* imap4d/append.c (imap4d_append0): Use mu_message_from_stream_with_envelope with crafted envelope. The effect is that the envelope of the message always reflects the actual sender, as deduced from the header (X-Envelope-Sender, Sender, From, in that order) and the date given with the APPEND command (or current date/time, if not given). * imap4d/tests/append00.at: Reflect changes in the envelope. * imap4d/tests/append01.at: Likewise. * imap4d/io.c (io_format_completion_response): Call imap4d_sync to emit eventual non-tagged responses before the tagged one. * include/mailutils/envelope.h (mu_envelope_set_destroy): New proto. * include/mailutils/header.h (MU_HEADER_SENDER): Remove duplicate define. * include/mailutils/imap.h (mu_imap_mailbox_create) (mu_imap_append_stream_size,mu_imap_append_stream) (mu_imap_append_message,mu_imapio_send_flags) (mu_imapio_send_time): New protos. * include/mailutils/imapio.h (mu_imapio_send_literal): Remove proto. (mu_imapio_send_literal_string) (mu_imapio_send_literal_stream): New protos. * include/mailutils/message.h (mu_message_from_stream_with_envelope): New proto. * include/mailutils/sys/imap.h (MU_IMAP_CLIENT_APPEND_RX): New state. * include/mailutils/sys/message_stream.h (_mu_message_stream) <envelope>: Rename to envelope_string. <construct_envelope>: New member. * libmailutils/imapio/literal.c: Remove. * libmailutils/imapio/litstream.c: New file. * libmailutils/imapio/litstring.c: New file. * libmailutils/imapio/time.c: New file. * libmailutils/imapio/Makefile.am: Add new files. * libmailutils/imapio/flags.c (mu_imapio_send_flags): New function. * libmailutils/imapio/qstring.c (mu_imapio_send_qstring_unfold): Use mu_imapio_send_literal_string. * libmailutils/mailbox/envelope.c (mu_envelope_set_destroy): New function. * libmailutils/stream/message_stream.c (mu_message_from_stream_with_envelope): New function. (mu_stream_to_message): Rewrite as an alternative entry point to the above. * libproto/imap/Makefile.am: Add new files. * libproto/imap/appmsg.c: New file. * libproto/imap/appstr.c: New file. * libproto/imap/appstrsiz.c: New file. * libproto/imap/mbcreate.c: New file. * mu/imap.c: Implement create and append.
Showing
25 changed files
with
713 additions
and
134 deletions
libmailutils/imapio/litstream.c
0 → 100644
libmailutils/imapio/time.c
0 → 100644
libproto/imap/appmsg.c
0 → 100644
libproto/imap/appstr.c
0 → 100644
libproto/imap/appstrsiz.c
0 → 100644
libproto/imap/mbcreate.c
0 → 100644
-
Please register or sign in to post a comment