summaryrefslogtreecommitdiff
path: root/mu/libexec/imap.c
AgeCommit message (Collapse)AuthorFiles
2024-01-06Update copyright yearsSergey Poznyakoff1
2023-01-22Update copyright yearsSergey Poznyakoff1
2022-01-02Update copyright yearSergey Poznyakoff1
2021-12-05Improve message append APISergey Poznyakoff1
The new API allows for specifying envelope and attributes (status) for the message being appended. * include/mailutils/attribute.h (MU_STATUS_BUF_SIZE): Order flags lexicographically. * include/mailutils/imap.h (mu_imap_append_stream_size) (mu_imap_append_stream) (mu_imap_append_message): Take envelope and attribute as arguments, instead of struct tm, mu_timezone, and flags. * include/mailutils/mailbox.h (mu_mailbox_append_message_ext): New proto. * include/mailutils/sys/amd.h (_amd_data): Change prototype of msg_finish_delivery: take additional mu_attribute_t argument. * include/mailutils/sys/mailbox.h (_mu_mailbox): Change prototype of _append_message: take mu_envelope_t and mu_attribute_t as additional arguments. * libmailutils/base/amd.c (_amd_message_save): Take mu_envelope_t argument. (amd_append_message): Take mu_envelope_t and mu_attribute_t arguments. Use them to alter message envelope and status. * libmailutils/mailbox/attribute.c (mu_attribute_unset_flags): Check return from mu_attribute_get_flags. (flagtrans): Order alphabetically. * libmailutils/mailbox/mailbox.c (mu_mailbox_append_message_ext): New function. (mu_mailbox_append_message): Rewrite as an alternative entry point to mu_mailbox_append_message_ext. * libmailutils/mailbox/msgenv.c (message_envelope_date): Give MU_HEADER_ENV_DATE higher priority than MU_HEADER_RECEIVED. (message_envelope_sender): Give X-Envelope-Sender higher priority than Return-Path. * libmailutils/stream/message_stream.c (mu_message_from_stream_with_envelope): Initialize attribute from MU_HEADER_STATUS. * testsuite/mbop.c (mbop_append): Options -attr, -sender, and -date can be used to alter message attributes and envelope. * libproto/dotmail/dotmail.c (mailbox_append_message) (dotmail_append_message): Take mu_envelope_t and mu_attribute_t arguments. Use them to alter message envelope and status. * libproto/dotmail/tests/append.at: Test modifying envelope and attributes during append. * libproto/dotmail/tests/testsuite.at: Force TZ=0. * libproto/imap/appmsg.c (mu_imap_append_message): Take mu_envelope_t and mu_attribute_t as arguments. * libproto/imap/appstr.c (mu_imap_append_stream): Likewise. * libproto/imap/appstrsiz.c (mu_imap_append_stream_size): Likewise. Use mu_attribute_t to set message flags and mu_envelope_t to set its delivery date. Note, that sender is not yet affected. * libproto/imap/mailbox.c (_imap_mbx_append_message): Take mu_envelope_t and mu_attribute_t as arguments. Use them to alter message envelope and status, via mu_imap_append_message. Altering envelope is done by amd.c * libproto/maildir/maildir.c (maildir_msg_finish_delivery): Take additional mu_attribute_t argument. Use it to alter message flags. Change msg->file_name if needed. * libproto/maildir/tests/append.at: Test modifying envelope and attributes during append. * libproto/mailer/mailbox.c (remote_mbox_append_message): Take mu_envelope_t and mu_attribute_t as arguments. Use mu_envelope_t to set sender address. mu_attribute_t is ignored, as SMTP does not transfer message attributes. * libproto/mbox/mboxrd.c (mailbox_append_message) (mboxrd_append_message): Take mu_envelope_t and mu_attribute_t as arguments. Use them to alter message envelope and status. * libproto/mbox/tests/append.at: Test modifying envelope and attributes during append. * libproto/mh/tests/append.at: Test modifying envelope and attributes during append. * mail/copy.c (append_to_mailbox): Preserve message status when appending. * mail/quit.c (mail_mbox_commit): Preserve message status when storing it to MBOX. * mail/tests/hold.at: Test whether message status is preserved. * mu/libexec/imap.c (com_append): Rewrite using the new mu_imap_append_stream call.
2021-08-25New function: mu_starttlsSergey Poznyakoff1
* libmu_auth/tlsfdstr.c (mu_tlsfd_stream_create): Accept conf==NULL. (mu_starttls): New function. * include/mailutils/tls.h (mu_starttls): New proto. * include/mailutils/imapio.h (mu_imapio_get_transport) (mu_imapio_set_transport): New functions. * libmailutils/imapio/transport.c (mu_imapio_get_transport) (mu_imapio_set_transport): New functions. * libmailutils/stream/iostream.c (mu_iostream_create): Accept NULL out stream. * libmailutils/stream/tcp.c: Support MU_IOCTL_FD (_tcp_instance): New member fd_borrowed. (_tcp_close): Don't close fd if fd_borrowed is set. (_tcp_ioctl): Handle MU_IOCTL_FD. * libmailutils/stream/xscript-stream.c (_xscript_ctl): Accept pstr[1] == NULL. * libmu_auth/notls.c (mu_tlsfd_stream_create) (mu_tlsfd_stream2_convert) (mu_starttls): New placeholders. * libproto/imap/folder.c (_mu_imap_folder_open): Use mu_tlsfd_stream_convert. Fix stream leak. * libproto/imap/starttls.c (mu_imap_starttls): Use mu_starttls. * libproto/mailer/smtp.c (smtp_open): Use mu_tlsfd_stream_convert. * libproto/mailer/smtp_starttls.c (mu_smtp_starttls): Use mu_starttls. * libproto/pop/pop3_stls.c (mu_pop3_stls): Likewise. * libproto/pop/mailbox.c (pop_open): Use mu_tlsfd_stream_convert. Fix stream leak. * mu/libexec/imap.c (com_connect): Use mu_tlsfd_stream_convert. Fix stream leak. * mu/libexec/pop.c: Likewise. * mu/libexec/smtp.c: Likewise. * imap4d/io.c (imap4d_init_tls_server): Use mu_starttls. * pop3d/extra.c: Likewise.
2021-08-19Provide program name for mu shell utilitiesSergey Poznyakoff1
* mu/libexec/imap.c (main): Set program name. * mu/libexec/pop.c: Likewise. * mu/libexec/smtp.c: Likewise.
2021-01-05Update copyright yearsSergey Poznyakoff1
2020-02-08Update copyright yearsSergey Poznyakoff1
2019-03-26Consistently use the term 'depth' when referring to directory nesting depthSergey Poznyakoff1
* include/mailutils/folder.h (mu_list_response): Rename 'level' to 'depth'. All uses updated.
2019-01-03Update copyright yearsSergey Poznyakoff1
2018-01-19Version 3.4.90; update copyright yearsSergey Poznyakoff1
2017-10-10Use mu_prtstr to safely print string valuesSergey Poznyakoff1
2017-06-20API for formatting message sets on outputSergey Poznyakoff1
* libmailutils/msgset/print.c (mu_msgset_formats): New global. (mu_stream_msgset_format): New function. * include/mailutils/msgset.h (mu_msgset_format): New struct. (mu_msgset_fmt_imap, mu_msgset_fmt_mh): New defines. (MU_MSGSET_IGNORE_TRANSERR): New flag (mu_msgset_copy, mu_msgset_translate): New protos. (mu_stream_msgset_format, mu_msgset_imap_print): New protos. (mu_msgset_print): Deprecate. * libmailutils/imapio/sendmsgset.c: Use mu_msgset_imap_print instead of mu_msgset_print. * mu/libexec/imap.c: Likewise. * libmailutils/msgset/Makefile.am: Add copy.c * libmailutils/msgset/add.c (mu_msgset_add_range): Translate if message set mode doesn't match the requested one. * libmailutils/msgset/sub.c (mu_msgset_sub_range): Likewise. * libmailutils/msgset/trans.c (_mu_msgset_translate_pair): Act according to the mode argument. (mu_msgset_translate): New function. * libmailutils/tests/msgset.c: New option -mh * mh/mh_sequence.c (write_sequence): Rewrite. * testsuite/msgset.c: Optionally translate uids to msgnums and vice-versa.
2017-04-11Rewrite the mailutils toolSergey Poznyakoff1
The subcommands are re-implemented as standalone binaries installed to pkglibexecdir. The main binary acts as a dispatcher. * configure.ac: Build mu/libexec/Makefile * include/mailutils/.gitignore: Ignore gitinfo.h * include/mailutils/opt.h (mu_parseopt_help_stream_create): New proto. * libmailutils/cli/cli.c (mu_cli_ext): Honor MU_PARSEOPT_PROG_NAME setting. * libmailutils/opt/help.c (mu_parseopt_create_help_stream): New function. (mu_program_help,mu_program_usage) (mu_program_version): Use it. * mu/Makefile.am: Move commands to separate executables under libexec. * mu/mu.c: Rewrite. * mu/dispatch.c: Remove. * mu/help.c: Remove. * mu/libexec/.gitignore: New file. * mu/libexec/Makefile.am: New file. * mu/libexec/getopt.c: New file. * mu/getans.c: Move to mu/libexec. * mu/getarg.c: Likewise. * mu/getyn.c: Likewise. * mu/util.c: Likewise. * mu/verbose.c: Likewise. * mu/shell.c: Likewise. * mu/mu.h: Remove. * mu/libexec/mu.h: New file. * mu/acl.c: Move to mu/libexec; Rewrite as a standalone program. * mu/cflags.c: Likewise. * mu/dbm.c: Likewise. * mu/filter.c: Likewise. * mu/flt2047.c: Likewise. * mu/imap.c: Likewise. * mu/info.c: Likewise. * mu/ldflags.c: Likewise. * mu/logger.c: Likewise. * mu/pop.c: Likewise. * mu/query.c: Likewise. * mu/send.c: Likewise. * mu/smtp.c: Likewise. * mu/stat.c: Likewise. * mu/wicket.c: Likewise. * mu/mu-setup.awk: Remove. * po/POTFILES.in: Update.

Return to:

Send suggestions and report system problems to the System administrator.