Implement a copy method in mailbox.
This method copies given messages (ificated by their sequence or UID numbers) to the given mailbox. So far this is implemented only in IMAP[S] folders. The mh/inc utility uses this method to optionally move incorporated messages to other folder (mailbox) instead of simply deleting them. * include/mailutils/imap.h (mu_imap_response) (mu_imap_response_code): New protos. (MU_IMAP_CB_TAGGED_OK,MU_IMAP_CB_TAGGED_NO) (MU_IMAP_CB_TAGGED_BAD): New callback codes. * include/mailutils/mailbox.h (MU_MAILBOX_COPY_UID) (MU_MAILBOX_COPY_CREAT): New constants. (mu_mailbox_msgset_copy) (mu_mailbox_message_copy): New protos. * include/mailutils/sys/imap.h (resp_code): Rename to response to avoid confusion. All uses updated. (response_code): New member. (_mu_imap_process_tagged_response): New proto. * include/mailutils/sys/mailbox.h (_mu_mailbox) <_copy>: New member. * libmailutils/mailbox/Makefile.am (libmailbox_la_SOURCES): Add copy.c * libmailutils/mailbox/copy.c: New file. * libproto/imap/err.c (mu_imap_response): New function. (mu_imap_response_code): New function. * libproto/imap/mbox.c (_imap_copy_to_mailbox) (_mu_imap_mailbox_init): Implement _copy method. * libproto/imap/resplist.c (IS_LBRACE,IS_RBRACE): Fix macros. * libproto/imap/response.c (_mu_imap_response): Call _mu_imap_process_tagged_response to process tagged responses. * libproto/imap/resproc.c (parse_response_code): Bugfix: expected ']' was set off by one. (resptab)<code>: New member. (_mu_imap_process_tagged_response): New function. * mh/inc.c (options, mh_option, opt_handler): New option --moveto. (move_to_mailbox): New variable. (main): If move_to_mailbox is set, move messages to that mailbox instead of deleting them. * mh/mh_getopt.h (mh_arg)<ARG_MOVETO>: New constant. * NEWS: Update. * include/mailutils/folder.h: Add a comment. * libmailutils/mailbox/folder.c: Minor formatting change.
Showing
26 changed files
with
307 additions
and
63 deletions
libmailutils/mailbox/copy.c
0 → 100644
-
Please register or sign in to post a comment