path: root/libmailutils
AgeCommit message (Collapse)AuthorFiles
2011-03-30Implement IPv6 support.Sergey Poznyakoff29
* am/ipv6.m4: New file. * examples/sa.c: New file. * include/mailutils/cidr.h: New file. * include/mailutils/sockaddr.h: New file. * libmailutils/cidr/ New file. * libmailutils/cidr/fromsa.c: New file. * libmailutils/cidr/fromstr.c: New file. * libmailutils/cidr/match.c: New file. * libmailutils/cidr/tosa.c: New file. * libmailutils/cidr/tostr.c: New file. * libmailutils/sockaddr/ New file. * libmailutils/sockaddr/copy.c: New file. * libmailutils/sockaddr/create.c: New file. * libmailutils/sockaddr/free.c: New file. * libmailutils/sockaddr/fromnode.c: New file. * libmailutils/sockaddr/insert.c: New file. * libmailutils/sockaddr/ipaddr.c: New file. * libmailutils/sockaddr/str.c: New file. * libmailutils/sockaddr/unlink.c: New file. * libmailutils/sockaddr/url.c: New file. * libmailutils/tests/cidr.c: New file. * Call MU_ENABLE_IPV6. Build libmailutils/sockaddr and libmailutils/cidr. * examples/.gitignore: Add mblconv and sa * examples/ (noinst_PROGRAMS): Add sa. * examples/aclck.c: Use new ACL API. * examples/echosrv.c: Use new mserv API. * include/mailutils/ (pkginclude_HEADERS): Add cidr.h and sockaddr.h * include/mailutils/acl.h (mu_acl_append, mu_acl_prepend) (mu_acl_insert): Change signatures. * include/mailutils/debug.h (mu_sockaddr_to_str): Remove proto. * include/mailutils/mailutils.h: Include cidr.h and sockaddr.h * include/mailutils/server.h (mu_ip_server_create): Change signature. (mu_ip_server_get_sockaddr): Likewise. (mu_m_server_set_default_address) (mu_m_server_get_default_address): Remove. * include/mailutils/stream.h (mu_tcp_stream_create_from_sa): New proto. * include/mailutils/types.hin (mu_cidr, mu_sockaddr): New structs. * include/mailutils/url.h (MU_URL_IPV6): New flag. (MU_URL_PARSE_DSLASH_OPTIONAL): New parse flag. * libmailutils/ Descend into cidr and sockaddr. Link in libcidr and libsockaddr. * libmailutils/diag/debug.c (mu_debug_log_begin): Flush mu_strerr. * libmailutils/diag/errors (MU_ERR_NONAME) (MU_ERR_BADFLAGS,MU_ERR_SOCKTYPE) (MU_ERR_FAMILY,MU_ERR_SERVICE): New errors. * libmailutils/server/acl.c: Rewrite API using mu_cidr. * libmailutils/server/ipsrv.c: Rewrite AI using mu_sockaddr. * libmailutils/server/msrv.c: Likewise. * libmailutils/stream/tcp.c: Likewise. * libmailutils/tests/.gitignore: Add cidr. * libmailutils/tests/ (noinst_PROGRAMS): Add cidr. * libmailutils/tests/url-parse.c: Support command line options to tune the parsing. * libmailutils/tests/ Pass options to url-parse. * libmailutils/url/create.c (getkn): Return meaningful error code. (_mu_url_ctx_parse_host): Accept IPv6 addresses. Set the MU_URL_IPV6 flag if one is given. (_mu_url_ctx_parse): Unless MU_URL_PARSE_DSLASH_OPTIONAL flag is given, request :// after scheme part. (mu_url_create): Add MU_URL_PARSE_DSLASH_OPTIONAL flag. * libmu_cfg/acl.c: Use new ACL API. * mu/acl.c: Likewise. * libproto/mailer/smtp.c (smtp_open): Use mu_tcp_stream_create_from_sa * libproto/pop/mbox.c (pop_open): Likewise. * mu/imap.c (com_connect): Likewise. * mu/pop.c (com_connect): Likewise. * testsuite/smtpsend.c (main): Likewise.
2011-03-23New filter "c-escape".Sergey Poznyakoff3
* libmailutils/filter/c-escape.c: New file. * include/mailutils/filter.h (mu_c_escape_filter): New extern. * libmailutils/filter/ (libfilter_la_SOURCES): Add c-escape.c * libmailutils/filter/filter.c (mu_filter_get_list): Add mu_c_escape_filter to the list.
2011-03-17More bugfixes.Sergey Poznyakoff4
* examples/mblconv.c (main): Return 0. * examples/murun.c (main): Fix iteration body. * imap4d/append.c: Do not pass constructed string as format argument to io_completion_response, use %s instead. * imap4d/close.c: Likewise. * imap4d/create.c: Likewise. * imap4d/delete.c: Likewise. * imap4d/rename.c: Likewise. * imap4d/status.c: Likewise. * libmailutils/base/mutil.c (mutil_parse_field_map): Fix return code in case of wordsplit failure. * libmailutils/cfg/parser.y (GETSNUM): Initialize sign. * libmailutils/stream/streamref.c (_streamref_ctl) <MU_IOCTL_SEEK_LIMITS>: Initialize lim. * libmailutils/string/wordsplit.c: Typecast format width arguments to int. * libmu_sieve/extensions/vacation.c (check_db): Initialize days. Pass correct time value to test_and_update_prop. * libproto/pop/mbox.c (pop_create_pop3_message): Fix return code. * mail/mail.c (do_and_quit): Pass the command to util_do_command via the %s format. * mail/unset.c (mail_unset): Likewise. * mh/mh_fmtgram.y (function production): LIkewise for mu_error. * mu/logger.c (mutool_logger): Fix return code in case of mu_stdstream_strerr_create failure.
2011-03-17Bugfixes.Sergey Poznyakoff1
* comsat/action.c (action_echo): Set omit_newline. * libmailutils/mailbox/mbx_default.c: Return 0 on success. Fix memory overrun. * libproto/mailer/smtp.c (smtp_open): Protect tls-related code with #ifdef WITH_TLS. * libproto/pop/mbox.c (pop_open): Likewise. * mu/imap.c (com_connect): Likewise. * mh/mhn.c (split_args): Preserve quotes. (mhn_compose_command): Handle type arguments (%a escape). (mhn_show_command): Likewise. (store_handler): Fix call to mh_getyn. (edit_mime): Pass typeargs to mhn_compose_command. Fix test for missing filename. * mh/tests/ (ali04): The test wrongly assumed that the `root' group has some members. * mh/tests/ Always sort the output from find. * mh/tests/ Likewise. * mh/tests/ Likewise. Filter out timestamps from the tar output produced by mhn. * tests/ (MH_SETUP): Define moreproc. * mh/tests/ Account for changes in mh_profile
2011-03-10message_stream: deduce default envelope address from the current user emailSergey Poznyakoff1
* libmailutils/stream/message_stream.c: Unless specified otherwise, set envelope address based on the current user email. * mh/tests/ Remove all X-Envelope headers before comparison.
2011-03-07New global variable mu_site_rcfile keeps the name of the site-wide ↵Sergey Poznyakoff1
configuration file. * include/mailutils/gocs.h (mu_site_rcfile): New extern. * include/mailutils/libcfg.h (MU_CONFIG_FILE): Remove. (mu_register_cfg_capa): Remove proto. (mu_libcfg_register_capa): New proto. * libmailutils/cfg/gocs.c (mu_site_rcfile): New variable. * libmu_argp/muinit.c (mu_app_init): Use mu_site_rcfile instead of MU_CONFIG_FILE. Destroy parse_tree when no longer needed. * libmu_cfg/init.c (cfg_capa_table): Static. (find_cfg_capa): Likewise. (reserved_name): Treat names starting with dot as reserved. (mu_libcfg_register_capa): New function. (mu_libcfg_parse_config): Use mu_site_rcfile instead of MU_CONFIG_FILE. * mu/query.c (mutool_query): Use mu_site_rcfile instead of MU_CONFIG_FILE.
2011-03-05Simplify mu_cfg_tree_reduce.Sergey Poznyakoff2
This function used to handle include/program statements, which is useless now, as these are expanded by mu_cfg_tree_postprocess. * include/mailutils/cfg.h (mu_cfg_tree_reduce): Change signature. (mu_format_config_tree): Change signature. (mu_config_clone_root_container): New proto. (mu_config_register_section): Rename to mu_config_root_register_section. mu_config_container_register_section. All uses changed. (mu_config_root_register_section): New proto. * libmailutils/cfg/driver.c (prog_parser) (_cb_include): Remove unnecessary code. (mu_build_container): Simplify. All uses updated. (mu_cfg_tree_reduce): Simplify invocation. All uses updated. * libmu_argp/muinit.c (mu_app_init): Re-implement --config-help support. * sieve/sieve.c (sieve_cfg_param): Fix docstring for "debug". * sieve/tests/ (MUT_SIEVE_DEFAULT_OPTIONS): New variable. (MUT_SIEVE_CMDLINE): Include MUT_SIEVE_DEFAULT_OPTIONS. (MUT_SIEVE_COMPILE): Pass MUT_SIEVE_DEFAULT_OPTIONS to sieve.
2011-03-05Introduce "parser hints", to provide better control over configuration parsing.Sergey Poznyakoff2
* include/mailutils/cfg.h (mu_cfg_parse_hints): New struct. (mu_cfg_tree_postprocess): Change signature. Last argument is struct mu_cfg_parse_hints *. (MU_CFG_PARSE_SITE_RCFILE,MU_CFG_PARSE_CUSTOM_RCFILE) (MU_CFG_PARSE_PROGRAM): New flags. (mu_cfg_parse_config): New proto. * libmailutils/cfg/lexer.l (mu_get_config): Fix call to mu_cfg_tree_postprocess. * libmailutils/cfg/parser.y (do_include): Takes hints as 2nd argument. (mu_cfg_tree_postprocess): Likewise. (mu_cfg_parse_config): New function. * libmu_cfg/init.c (mu_libcfg_parse_config): Rewrite as a wrapper over mu_cfg_parse_config. * libmu_argp/muinit.c (mu_app_init): Update. * mu/query.c: New option --program. (mutool_query): Use mu_cfg_parse_config interface.
2011-03-04mu: improve query interface.Sergey Poznyakoff2
* include/mailutils/cfg.h (mu_cfg_node) <parent>: New member. (MU_CFG_FMT_VALUE_ONLY) (MU_CFG_FMT_PARAM_PATH): New flags. * libmailutils/cfg/format.c (format_path): New static. (format_node,format_node_end): Handle new flags. (mu_cfg_format_node): Clear MU_CFG_FMT_VALUE_ONLY if the requested node is mu_cfg_node_statement. * libmailutils/cfg/parser.y: Set node parents. (mu_cfg_find_node): Fix coredump. * mu/query.c: New options --value and --path.
2011-03-04BugfixesSergey Poznyakoff1
* libmailutils/server/acl.c (_run_entry): Fix log output. * mu/shell.c: Fix compilation without readline.
2011-01-21Scheme: add primitives for manipulating the MU debug levels.Sergey Poznyakoff2
* include/mailutils/debug.h (mu_debug_get_iterator): New proto. * libmailutils/diag/debug.c (mu_debug_get_iterator): New function. * libmu_scm/ (lib_LTLIBRARIES): Add mu_debug.c. * include/mailutils/guile.h (mu_scm_debug_init): New proto. * libmu_scm/mu_scm.c (mu-register-format): Bugfix. (mu_scm_init): Call mu_scm_debug_init.
2011-01-19BugfixSergey Poznyakoff1
* libmailutils/base/amd.c: Add more debugging info. Always check the return from amd_pool_open and amd_check_message (which returns int now) and act accordingly.
2011-01-16Add useful debugging hooks.Sergey Poznyakoff7
* libmailutils/diag/bt.c: New file. * libmailutils/diag/wd.c: New file. * libmailutils/diag/ (libdiag_la_SOURCES): Add bt.c and wd.c * include/mailutils/debug.h (mu_gdb_bt, mu_wd): New protos. * include/mailutils/util.h (mu_getmaxfd): New protos. * libmailutils/base/getmaxfd.c: New file. * libmailutils/base/ (libbase_la_SOURCES): Add getmaxfd.c * libmailutils/server/acl.c: Use mu_getmaxfd. * libmailutils/stream/prog_stream.c: Likewise. * mh/mh_whatnow.c: Likewise. * libmu_scm/mu_body.c (mu-body?): Bugfix.
2011-01-15libmailutils: bugfixSergey Poznyakoff1
* libmailutils/mime/attachment.c (_attachment_setup): Remove improper initialization of msg. (mu_message_encapsulate): Initialize info->msg.
2011-01-02Update copyright years.Sergey Poznyakoff216
Happy GNU year!
2010-12-30Provide a function for quick retrieval of message lines.Sergey Poznyakoff2
* include/mailutils/message.h (mu_message_quick_lines): New proto. (mu_message_set_lines): Change signature of the 2nd argument. * include/mailutils/sys/message.h (_mu_message) <lines>: Change signature. * libmailutils/diag/errors (MU_ERR_INFO_UNAVAILABLE): New error code. * libmailutils/mailbox/message.c (mu_message_set_lines): Change signature of the 2nd argument. (mu_message_lines): Update call to the _lines method. (mu_message_quick_lines): New function. * libproto/pop/mbox.c (_POP3_MSG_LINES): New flag. (_pop3_message)<message_lines>: New member. (pop_create_pop3_message): New function. (pop_scan): Use LIST to obtain scan listing. (pop_message_lines): New function. (pop_create_message): Set _lines method. (pop_get_message): Use pop_create_pop3_message. * mail/from.c (hdr_quick_lines): New function. (compile_headline): New escape %L * pop3d/capa.c (pop3d_capa): Show XLINES capability if configured. * pop3d/list.c (pop3d_list): Optionally output the number of lines in the message. * pop3d/pop3d.c (pop3d_xlines): New global. (pop3d_cfg_param): New statement "scan-lines". * pop3d/pop3d.h (pop3d_xlines): New extern.
2010-12-29amd: bugfixes; speed up expunging.Sergey Poznyakoff1
* libmailutils/base/amd.c (_amd_message_delete): Remove. (amd_array_expand): Fix element size. (amd_array_shrink): Rewrite. (amd_expunge): Shrink the array once, after everything has been expunged. Generate MU_EVT_MAILBOX_MESSAGE_EXPUNGE for each expunged message.
2010-12-29Make sure debugging calls don't dump core even if mu_strerr is not initialized.Sergey Poznyakoff1
* libmailutils/diag/debug.c (mu_debug_log, mu_debug_log_begin): Call mu_diag_init.
2010-12-29Bugfixes.Sergey Poznyakoff2
* libmailutils/url/create.c (_mu_url_create_internal): Fix parsing of the '|' shortcuts. * libmailutils/tests/ Fix '|' test. Add 'prog://' test. * movemail/movemail.c (set_program_id): Call mu_stdstream_strerr_setup to flush changes. * frm/common.c: Minor changes
2010-12-28imap4d: speed up asynchronous mailbox notifications.Sergey Poznyakoff2
* imap4d/imap4d.h (util_format_attribute_flags): New prototype. * imap4d/sync.c: Rewrite using flag table to keep attribute flags, mu_mailbox_translate to convert uids to message numbers and MU_EVT_MAILBOX_MESSAGE_EXPUNGE event to report expunged messages. * imap4d/util.c (_imap4d_attrlist): Remove \Recent (util_attribute_to_type): Handle \Recent separately. (util_format_attribute_flags): New function. (util_print_flags): Rewrite as an extra entry point to the above. mailboxes: New event MU_EVT_MAILBOX_MESSAGE_EXPUNGE. * include/mailutils/observer.h: Rearrange and partially rename event constants (all uses updated): MU_EVT_MESSAGE_APPEND => MU_EVT_MAILBOX_MESSAGE_APPEND MU_EVT_AUTHORITY_FAILED => MU_EVT_FOLDER_AUTHORITY_FAILED (MU_EVT_MAILBOX_MESSAGE_EXPUNGE): New event. * libproto/mbox/mbox.c: Generate MU_EVT_MAILBOX_MESSAGE_EXPUNGE. * libproto/pop/mbox.c: Likewise. * libmailutils/base/amd.c: Likewise.
2010-12-28mh,maildir: speed up scanning.Sergey Poznyakoff1
* include/mailutils/sys/amd.h (_amd_message_append, amd_sort): New protos. * libmailutils/base/amd.c (amd_array_expand): Call memmove only if there is actually something to move. (_amd_message_append, amd_sort): New functions. * libproto/maildir/mbox.c (maildir_scan_dir): Append new messages to the end of the array, and sort it afterwards. This avoids unnecessary memory moves, which improves performance considerably, especially on large mailboxes. * libproto/mh/mbox.c (mh_scan0): Likewise.
2010-12-27vacation: remove dependency on DBM; other minor fixes.Sergey Poznyakoff1
* libmu_sieve/extensions/vacation.c: Use _sget accessors where possible. Use mu_property_t instead of db database. * libmu_sieve/sieve.y (mu_sieve_get_mailer): Verbosely report errors. * libmailutils/base/locker.c (mu_locker_create): Create the locker if the file name part of its full name does not exist.
2010-12-23movemail: minor improvements.Sergey Poznyakoff2
* libmailutils/base/list.c (list_itrctl): Accept mu_itrctl_set_direction and mu_itrctl_qry_direction even if mu_iterator_first has not been called yet. * movemail/movemail.c: Rewrite using iterators. * libmailutils/mailer/mailer.c (safe_address_create): Bugfix.
2010-12-23mailbox iterator: implement reverse direction and itrctl.Sergey Poznyakoff2
* libmailutils/mailbox/mbxitr.c (mailbox_iterator)<backwards>: New member. (mbx_first): Position to the last message if itr->backwards is set. (mbx_next): Decrement index if itr->backwards is set. (mbx_finished_p): Take into account iteration direction. (mbx_itrctl): new method. (mu_mailbox_get_iterator): Set itrctl method.
2010-12-23mailer: minor improvementSergey Poznyakoff1
Be more liberal when guessing sender and recipient names. Tolerate deviations from RFC822. * libmailutils/mailer/mailer.c (copy_fragment) (recover_email, safe_address_create): New functions. (_set_from, _set_to): Use safe_address_create.
2010-12-23BugfixesSergey Poznyakoff1
* libmailutils/base/lcall.c (mu_parse_lc_all): Allow for arg==NULL. * mh/ Define mhlibdir. * mh/pick.y (match_header): Use sget accessors. * mh/repl.c: Accept -noquery silently.
2010-12-23Bugfixes.Sergey Poznyakoff1
* libmailutils/stream/logstream.c (_log_ctl): Handle MU_IOCTL_SYSLOGSTREAM, pass it to the transport stream. * libmu_sieve/sieve.l (pop_source): Restore input_stream. * libmu_sieve/util.c (mu_sieve_error, mu_sieve_debug) (mu_sieve_log_action): Set location information on the errstream.
2010-12-22Improve debug parser and output functions.Sergey Poznyakoff6
New parser accepts range specifications (mailbox.trace3-prot). mu_debug_format_spec outputs specs in the canonical form. * include/mailutils/debug.h (MU_DEBUG_LEVEL_RANGE): New macro. (mu_debug_set_category_level): Change return type to int. (mu_debug_get_category_level): New proto. * libmailutils/diag/debug.c (mu_debug_set_category_level): Change return type to int. (mu_debug_get_category_level): New function. (mu_debug_level_from_string): New function. (parse_spec): Accept range specification. Negation at the start of spec implies 'proto'. (mu_debug_format_spec): Rewrite. * libmailutils/tests/debugspec.c: New file. * libmailutils/tests/ New file. * libmailutils/tests/ (noinst_PROGRAMS): Add debugspec. (TESTSUITE_AT): add * libmailutils/tests/ Include * libmailutils/tests/.gitignore: Add debugspec. * sieve/sieve.c: Do not advertise 'T' and 'P' arguments to --debug. (debug_level): Remove. (set_debug_level): Rewrite the handling of legacy debug specifiers 'TP'.
2010-12-22Improve debugging; fix c522de119a.Sergey Poznyakoff4
* include/mailutils/types.hin (mu_debug_handle_t) (mu_debug_level_t): New data types. * include/mailutils/debug.h (mu_debug_level_p) (mu_debug_category_level) (mu_debug_set_category_level): Change argument types to mu_debug_handle_t/mu_debug_level_t. * libmailutils/diag/debug.c: Likewise. * libmailutils/server/acl.c (_run_entry): Call mu_debug_log_nl instead of mu_debug_log_end with an empty format string. * include/mailutils/sieve.h * libmailutils/filter/base64.c * libmailutils/stream/stream.c * libmu_sieve/conf.c * libmu_sieve/extensions/spamd.c * libmu_sieve/sieve.y * sieve/sieve.c: Commit the changes c522de119a failed to commit.
2010-12-22Bugfixes.Sergey Poznyakoff1
* libmailutils/filter/iconvflt.c (_icvt_decoder): Do not iconv_close if cd is -1. * mh/mboxprop.c (mh_mailbox_get_cur): Ignore whitespace following the cur value.
2010-12-22Minor fixesSergey Poznyakoff1
* libmu_sieve/extensions/pipe.c: Include sys/wait.h * testsuite/ Distribute
2010-12-22filter stream: make sure all input data get processed.Sergey Poznyakoff1
* include/mailutils/filter.h (MU_FILTER_MAX_AGAIN): Add a comment. * libmailutils/stream/fltstream.c (filter_read): Use mu_debug on the filter.error level, instead of plain mu_error. If the xcoder returns OK and does not consume all input when processing the last buffer, assume mu_filter_again. Fix loop condition. (filter_write_internal): Use mu_debug on the filter.error level, instead of plain mu_error.
2010-12-22sieve: bugfixesSergey Poznyakoff1
* include/mailutils/sieve.h (mu_sieve_debug_handle): New declaration. (mu_sieve_debug_init): New prototype. * libmu_sieve/conf.c (mu_sieve_debug_handle): New global. (mu_sieve_module_init): Call mu_sieve_debug_init. * libmu_sieve/extensions/spamd.c (spamd_connect_tcp) (spamd_connect_socket): Fix stream creation. (spamd_send_message): Switch to full buffering on the transport stream and indicate it is a payload (in case transcript is enabled), before copying data. Restore things to their original state afterwards. (spamd_read_line): Rewrite using mu_stream_getline. (decode_float): Additional argument endp. Unless NULL, store there the position in the input string where the parsing has stopped. (parse_response_line): New function. (spamd_test): Rewrite using new API. * sieve/sieve.c (parser): --dry-run implies --verbose. * libmailutils/filter/base64.c (_base64_decoder): when not enough data are available and cmd is not mu_filter_lastbuf, return mu_filter_lastbuf. * libmailutils/stream/stream.c (mu_stream_shutdown): Flush the buffers before shutting the transport down. * libmailutils/tests/fltst.c (main): New option bufsize=
2010-12-22Pop3-client bugfixes (mostly).Sergey Poznyakoff1
* libmailutils/stream/fltstream.c (filter_ctl): MU_IOCTL_TRANSPORT returns filter transport stream. * libproto/pop/pop3_rdlist.c (mu_pop3_stream_to_list): Make sure status is initialized and reflects the actual status. * libproto/pop/pop3_stream.c (mu_pop3_filter_create): Do not unref transport stream, it is done by the caller.
2010-12-21Minor fixes.Sergey Poznyakoff1
* am/enable.m4 (MU_ENABLE_SUPPORT): Add the additional-cond argument. (MU_ENABLE_BUILD): Likewise. * Update 4th args in calls to MU_ENABLE_SUPPORT. Do not use MU_ENABLE_BUILD within conditionals, use additional-cond instead. * libmailutils/stream/mapfile_stream.c: Include sys/stat.h
2010-12-20Assorted changesSergey Poznyakoff5
* include/mailutils/debug.h (mu_debug_format_spec): New function. * include/mailutils/stream.h (MU_IOCTL_SYSLOGSTREAM) (MU_IOCTL_FILTER): New ioctls. (MU_IOCTL_LOGSTREAM_GET_SEVERITY_MASK) (MU_IOCTL_LOGSTREAM_SET_SEVERITY_MASK) (MU_IOCTL_LOGSTREAM_CLONE) (MU_IOCTL_SYSLOGSTREAM_SET_LOGGER) (MU_IOCTL_SYSLOGSTREAM_GET_LOGGER) (MU_IOCTL_FILTER_GET_DISABLED) (MU_IOCTL_FILTER_SET_DISABLED): And their opcodes. * include/mailutils/sys/filter.h (_MU_FILTER_DISABLED) (_MU_FILTER_EOF): New defines. (_mu_filter_stream) <eof>: Replace with fltflag (a bitmask). * include/mailutils/sys/logstream.h (_mu_log_stream) <sevmask>: New member. * include/mailutils/sys/syslogstream.h (_mu_syslog_stream) <logger>: New member. * include/mailutils/util.h (mu_onexit_run): New proto. * libmailutils/base/onexit.c (_mu_onexit_run): Extra safety check. (mu_onexit_run): New function. (mu_debug_level_str): New static. (mu_debug_format_spec): New function. * libmailutils/stream/fltstream.c (filter_read, filter_write): Bypass the xcoder if _MU_FILTER_DISABLED is set. Use fltflag instead of the removed eof. (filter_ctl): Handle MU_IOCTL_FILTER. * libmailutils/stream/logstream.c (_log_write): The sevmask member masks out severity prefix output for certain severities. (_log_ctl): Handle new opcodes (see above). * libmailutils/stream/syslogstream.c (_syslog_stream_write): Use <logger>, if supplied, instead of the system syslog(3). (_syslog_ctl): Handle MU_IOCTL_SYSLOGSTREAM. (mu_syslog_stream_create): Initialize logger to NULL. * mu/ldflags.c (lib_descr): Protect entries with the corresponding #ifdef ENABLE_whatever.
2010-12-19maildir: speed up mailbox scanningSergey Poznyakoff1
* include/mailutils/sys/amd.h (_amd_message_lookup_or_insert): New proto. * libmailutils/base/amd.c (_amd_message_lookup_or_insert): New function. (_amd_message_insert): Rewrite using _amd_message_lookup_or_insert. * libproto/maildir/mbox.c (maildir_message_cmp): Stop comparison on ':'. (maildir_message_lookup): Remove. (maildir_scan_dir): Use _amd_message_lookup_or_insert. * po/ Update.
2010-12-19Minor fixes.Sergey Poznyakoff4
* include/mailutils/debug.h (mu_debug_log_nl): New proto. * libmailutils/diag/debug.c (mu_debug_log_nl): New function. * libmailutils/mailer/progmailer.c: Use mu_debug_log_nl. * libmailutils/server/acl.c: Likewise. Also, use MU_DEBUG_TRACE9 instead of the numeric value. * libmailutils/filter/iconvflt.c (_iconv_filter): Register encoder (same as decoder).
2010-12-17Improve debugging in the category "auth".Sergey Poznyakoff1
* libmailutils/auth/mu_auth.c: Fix mu_debug calls. Use different levels. Remove --debug-auth option. Users should use --debug-level=auth instead. * libmu_argp/auth.c: Remove. * libmu_argp/ (libmu_argp_a_SOURCES): Remove auth.c * include/mailutils/libargp.h (mu_auth_cmdline): Remove. * libmu_argp/cmdline.c (all_cmdline_capa): Remove mu_auth_cmdline.
2010-12-13Remove mu_filter_iconv_create.Sergey Poznyakoff8
Callers should use mu_filter_create_args instead. * examples/iconv.c: Rewrite using mu_filter_create_args. * libmailutils/mime/mimehdr.c (mu_mimehdr_decode_param): Use mu_decode_filter. * imap4d/imap4d.h: Include prog.h * include/mailutils/filter.h (mu_filter_iconv_create): Mark as deprecated. * include/mailutils/util.h (mu_decode_filter_args): New proto. * libmailutils/base/msgid.c (mu_rfc2822_in_reply_to): Silence a cast warning. * libmailutils/tests/wicket.c (match_string): Likewise. * libmailutils/filter/decode.c (mu_decode_filter_args): New function. (mu_decode_filter): Rewrite as an alternative entry point to mu_decode_filter_args. * ibmailutils/filter/filter_iconv.c: Remove. * libmailutils/filter/ (libfilter_la_SOURCES): Remove filter_iconv.c * libmu_compat/filter_iconv.c: New file. * libmu_compat/ (libmu_compat_la_SOURCES): Add filter_iconv.c * libmailutils/filter/iconvflt.c (_icvt_decoder): Set errcode before returning failure. * libmailutils/stream/fltstream.c (init_iobuf, filter_stream_init): Provide a default value for io->errcode.
2010-12-13Re-implement iconv convertor as a regular filter.Sergey Poznyakoff3
* include/mailutils/filter.h (mu_iconv_filter): New extern. * libmailutils/filter/iconvflt.c: New file. * libmailutils/filter/ (libfilter_la_SOURCES): Add iconvflt.c * libmailutils/filter/filter.c (mu_filter_get_list): Register mu_iconv_filter.
2010-12-11Minor fixes.Sergey Poznyakoff2
* libmailutils/base/argcvjoin.c (mu_argcv_join): Fix a memory allocation error. * libmailutils/base/msgid.c (concat): Remove. (mu_rfc2822_references,mu_rfc2822_in_reply_to): Use mu_argcv_join to concatenate strings.
2010-12-11mh,maildir: Minor fix.Sergey Poznyakoff1
* libmailutils/base/amd.c (amd_envelope_date): Remove the trailing newline from the ctime output.
2010-12-11mail: rewrite using MU streams.Sergey Poznyakoff2
* libmailutils/base/spawnvp.c (mu_spawnvp): Use fork and _exit, unconditionally. * libmailutils/stdstream/basestr.c (mu_stdstream_setup): Borrow descriptors 0, 1, 2. * mail/mail.h (compose_env) <filename, file, ofile>: Remove. <compstr>: New member. * mail/alias.c: Use MU streams instead of stdlib. * mail/alt.c: Likewise. * mail/copy.c: Likewise. * mail/decode.c: Likewise. * mail/echo.c: Likewise. * mail/envelope.c: Likewise. * mail/eq.c: Likewise. * mail/escape.c: Likewise. * mail/followup.c: Likewise. * mail/from.c: Likewise. * mail/inc.c: Likewise. * mail/mail.c: Likewise. * mail/mailline.c: Likewise. * mail/mailvar.c: Likewise. * mail/msgset.y: Likewise. * mail/print.c: Likewise. * mail/quit.c: Likewise. * mail/reply.c: Likewise. * mail/retain.c: Likewise. * mail/send.c: Likewise. * mail/setenv.c: Likewise. * mail/shell.c: Likewise. * mail/size.c: Likewise. * mail/source.c: Likewise. * mail/summary.c: Likewise. * mail/top.c: Likewise. * mail/unset.c: Likewise. * mail/util.c: Likewise. * mail/version.c: Likewise. * mail/write.c: Likewise. * mail/z.c: Likewise.
2010-12-11Minor change.Sergey Poznyakoff1
* libmailutils/stream/stream.c (mu_stream_set_stat): Allow for statbuf==NULL.
2010-12-11Implement mu_onexit functions; use MU stdstream in mh and mimeview.Sergey Poznyakoff3
* include/mailutils/types.hin (mu_onexit_t): New typedef. * include/mailutils/util.h (mu_onexit_reset, mu_onexit): New protos. * libmailutils/base/onexit.c: New file. * libmailutils/base/ (libbase_la_SOURCES): Add onexit.c * libmailutils/stdstream/basestr.c (stdstream_flushall): New function. (mu_stdstream_setup): Rewrite the fd checking algorithm. Register stdstream_flushall as an onexit function. * mh/anno.c: Use MU stdstream. * mh/mh.h: Include mailutils/stdstream.h. * mh/mh_init.c (mh_init): Call mu_stdstream_setup; use MU stdstream. * mh/mh_whatnow.c (_whatnow): Use MU stdstream. * mh/mhl.c (open_output,list_message): Likewise. * mh/mhn.c (mhn_show,store_handler): Likewise. * pop3d/popauth.c: Use MU stdstream. * mimeview/mimetypes.y: Use MU stdstream. * mimeview/mimeview.c: Likewise. (mimeview_fp): Remove. (mimeview_stream): New variable. * mimeview/mimeview.h (mimeview_fp): Remove. (mimeview_stream): New variable. * lib/mailcap.c (find_entry): Don't report ENOENT.
2010-12-10Remove the MU_STREAM_FD_AUTOCLOSE stream flag.Sergey Poznyakoff8
This is the default behavior now. The reverse can be requested by a special MU_IOCTL_FD,MU_IOCTL_FD_SET_BORROW ioctl. * include/mailutils/stream.h (MU_STREAM_FD_AUTOCLOSE): Remove. This is the default behavior now. (MU_IOCTL_FD): New ioctl. (MU_IOCTL_FD_GET_BORROW, MU_IOCTL_FD_SET_BORROW): New opcodes. * include/mailutils/sys/file_stream.h (_MU_FILE_STREAM_FD_BORROWED): New flag. * libmailutils/stream/file_stream.c (fd_close): Close the fd unless _MU_FILE_STREAM_FD_BORROWED bit is set. (fd_open): Clear the _MU_FILE_STREAM_FD_BORROWED bit. (fd_ioctl): Handle MU_IOCTL_FD. (mu_file_stream_create): Remove MU_STREAM_FD_AUTOCLOSE. * ibmailutils/base/version.c (mu_print_options): Set borrow mode on the temporary stdout stream. * libmailutils/cfg/driver.c (mu_cfg_tree_reduce): Set borrow mode on the temporary stderr stream. * libmailutils/stdstream/strerr.c (mu_stdstream_strerr_create): Set borrow mode on the stderr stream. * libmailutils/tests/tempfile.c: set borrow mode on the temporary stream, because it may be reopened later (verify mode). * examples/mta.c: Remove MU_STREAM_FD_AUTOCLOSE. * imap4d/io.c: Likewise. * libmailutils/stream/prog_stream.c: Likewise. * libmailutils/stream/socket_stream.c: Likewise. * libmailutils/stream/temp_file_stream.c: Likewise. * maidag/lmtp.c: Likewise. * pop3d/extra.c: Likewise. These will disappear when the corresponding utilities are rewritten to use MU stdstream: * mail/escape.c (quote0): set borrow mode on the output stream. * mimeview/mimeview.c (display_file): set borrow mode on the input stream. Likewise, these will disappear when MH uses MU stdstream: * mh/anno.c (main): Set borrow mode on the input stream. * mh/mh_init.c (mh_real_install): Likewise. * mh/mh_whatnow.c (_whatnow): Likewise. * mh/mhl.c (open_output): Set borrow mode on the output stream. * mh/mhn.c (mhn_show,store_handler): Likewise.
2010-12-10Remove MU_STREAM_AUTOCLOSE flag. Use mu_stream_unref, if necessary.Sergey Poznyakoff11
* examples/mta.c: Use MU_STREAM_FD_AUTOCLOSE. * imap4d/io.c: Likewise. * libmailutils/stream/file_stream.c: Likewise. * libmailutils/stream/prog_stream.c: Likewise. * libmailutils/stream/socket_stream.c: Likewise. * libmailutils/stream/temp_file_stream.c: Likewise. * maidag/lmtp.c: Likewise. * pop3d/extra.c: Likewise. * imap4d/preauth.c: Do not use MU_STREAM_AUTOCLOSE. Instead unref the transport stream after creating the derived one. * libmailutils/base/rfc2047.c: Likewise. * libmailutils/stream/fltstream.c: Likewise. * libmailutils/tests/fltst.c: Likewise. * libmu_auth/ldap.c: Likewise. * libmu_auth/tls.c: Likewise. * libmu_sieve/extensions/vacation.c: Likewise. * libproto/pop/pop3_stream.c: Likewise. * mail/decode.c: Likewise. * mh/mhn.c: Likewise. * libmailutils/filter/filter_iconv.c: Do not handle MU_STREAM_AUTOCLOSE. * libmailutils/stream/rdcache_stream.c: Likewise. * libmailutils/stream/streamref.c: Likewise. * libmailutils/stream/xscript-stream.c: Likewise. * include/mailutils/stream.h (MU_STREAM_AUTOCLOSE): Rename to MU_STREAM_FD_AUTOCLOSE.
2010-12-09Implement filter chains. Revamp filter output length support.Sergey Poznyakoff16
* include/mailutils/filter.h (mu_filter_chain_create_pred) (mu_filter_chain_create): New prototypes. (_mu_filter_record)<max_line_length>: Remove. * libmailutils/filter/fltchain.c: New file. * libmailutils/filter/ (libfilter_la_SOURCES): Add fltchain.c. * libmailutils/filter/base64.c: Implement line length limit for encoder. (base64_state): New enum. (base64_line): New struct. (_base64_encoder): xd brings a pointer to struct base64_line. Use it to limit the output line length. (alloc_state): New function. (_base64_filter): Register alloc_state. (_base64_filter, _B_filter): Remove max_line_length initialization. * libmailutils/filter/binflt.c: Remove max_line_length initialization. * libmailutils/filter/crlfflt.c: Likewise. * libmailutils/filter/dot.c: Likewise. * libmailutils/filter/fromflt.c: Likewise. * libmailutils/filter/header.c: Likewise. * libmailutils/filter/inline-comment.c: Likewise. * libmailutils/filter/linecon.c: Likewise. * libmailutils/filter/qpflt.c: Likewise. * libmailutils/filter/linelenflt.c: Redo line filter as a regular filter. (mu_linelen_filter): New global. * libmailutils/filter/filter.c (mu_filter_get_list): Register mu_linelen_filter. (filter_create_rd, filter_create_wr): Remove. (mu_filter_create_args): Use mu_filter_stream_create directly. * examples/base64.c: Re-implement the -l option via filter chains. * libmailutils/tests/fltst.c: Remove the linelen option. * libmailutils/tests/ Remove the linelen option from fltst invocations. * mu/filter.c: Remove the --line-length option. Not needed now, its effect is achieved by "FLT + [~]linelen" chain.
2010-12-08Minor improvements in logstream and related code.Sergey Poznyakoff1
* include/mailutils/stream.h (MU_IOCTL_LOGSTREAM_SET_LOCUS_LINE) (MU_IOCTL_LOGSTREAM_SET_LOCUS_COL): New subcodes. * libmailutils/stream/logstream.c (_log_ctl): Handle two new subcodes. * comsat/action.c (eval_biffrc): Use new ioctl subcode to update the line number.

Return to:

Send suggestions and report system problems to the System administrator.