summaryrefslogtreecommitdiff
path: root/sieve
AgeCommit message (Collapse)AuthorFiles
2024-01-06Update copyright yearsSergey Poznyakoff36
2023-01-22Update copyright yearsSergey Poznyakoff36
2022-02-08mbox format: don't count terminating empty line as part of messageSergey Poznyakoff2
* configure.ac: Version 3.14.90 * NEWS: Version 3.14.90 * libproto/mbox/mboxrd.c (scan_message_finalize): Take decrement value (n) without additional corrections. All uses changed. (mailbox_append_message): Fix padding. * libproto/mbox/message.c (_msg_stream_setup) (mboxrd_message_body_scan,_msg_body_setup): Don't count terminating empty line as part of the message body. * libproto/mbox/tests/lastmsg.at: New test. * libproto/mbox/tests/Makefile.am: Add new files. * libproto/mbox/tests/testsuite.at: Likewise. * libproto/mbox/tests/append.at: Test appending to partially terminated mailboxes. * libproto/mbox/tests/body.at: Fix expected octet and line counts. * libproto/mbox/tests/attr.at: Likewise. * libproto/mbox/tests/autodetect.at: Likewise. * libproto/mbox/tests/count.at: Likewise. * libproto/mbox/tests/env.at: Likewise. * libproto/mbox/tests/notify.at: Likewise. * libproto/mbox/tests/qget.at: Likewise. * comsat/tests/testsuite.at: Likewise. * imap4d/tests/IDEF0956.at: Likewise. * imap4d/tests/fetch.at: Likewise. * libmu_scm/tests/mailbox-append-message.at: Likewise. * libmu_scm/tests/mailbox-expunge.at: Likewise. * libmu_scm/tests/mailbox-get-message.at: Likewise. * libmu_scm/tests/mailbox-iterate.at: Likewise. * libtests/mime.at: Likewise. * mail/tests/align.at: Likewise. * mail/tests/hold.at: Likewise. * mail/tests/nohome.at: Likewise. * mail/testsuite/mail/Followup.exp * mail/testsuite/mail/Reply.exp * mail/testsuite/mail/folder.exp * mail/testsuite/mail/followup.exp * mail/testsuite/mail/read.exp * mail/testsuite/mail/reply.exp * mail/testsuite/mail/tag.exp * mail/testsuite/mail/z.exp * pop3d/testsuite/pop3d/read.exp * readmsg/tests/all.at: Likewise. * readmsg/tests/hdr.at: Likewise. * readmsg/tests/nohdr.at: Likewise. * readmsg/tests/twomsg.at: Likewise. * readmsg/tests/weed.at: Likewise. * sieve/tests/redirect.at: Likewise. * sieve/tests/reject.at: Likewise.
2022-01-02Update copyright yearSergey Poznyakoff36
2021-11-20Fix typosSergey Poznyakoff1
2021-06-11Fix handling of MIME messages that have only one part.Sergey Poznyakoff1
* libmailutils/mime/mime.c (_mime_part_size): Fix handling of one part MIME messages. Don't touch psize memory in case of error. (_mime_body_stream_read): Fix handling of one part MIME messages. Previous implementation used to add an extra newline at the end. * mh/tests/mhn.at: Reflect the above changes. * sieve/tests/vacation.at: Reflect the above changes.
2021-01-05Minor changesSergey Poznyakoff1
2021-01-05Update copyright yearsSergey Poznyakoff36
2020-11-25Replace mbox format driver with mboxrbSergey Poznyakoff5
* NEWS: update * configure.ac: Revert 9763fd4a. * include/mailutils/registrar.h: Likewise. * libproto/Makefile.am: Likewise. * libmailutils/stream/stream.c (mu_stream_size): Fix size calculation in case of line and full buffering scheme. * libmailutils/stream/streamcpy.c (mu_stream_copy_nl): Change semantics. Ensure that the copied data ends with two newline characters. Append them if necessary. * testsuite/mbop.c: New commands: message_lines and message_size. * libproto/mbox/mboxrb.c (mboxrb_mailbox_init_stream): Always add MU_STREAM_READ permission. Use the same flags for mu_mapfile_stream_create and mu_file_stream_create. (mboxrb_rescan_unlocked): Count terminating newline as part of the message. (mailbox_append_message): Make sure each message ends with an empty line. (mboxrb_tracker_sync): Update mailbox mesg_count. (mboxrb_flush_temp): Truncate the temporary stream to the new size. (mboxrb_flush_unlocked): Clear all modifications only in FLUSH_UIDVALIDITY mode. (mboxrb_message_copy_with_uid): Fix message_end computation. Use mu_stream_copy_nl to copy message body. (mu_mboxrb_message_reconstruct): Update ref on return. * po/POTFILES.in: Update. * mail/copy.c (append_to_file): Use mu_stream_stat_buffer to compute statistics. * mail/mail.c: Allow for opening read-only mailboxes. * libproto/mbox/tests/body.at: Fix the expected byte count. * libproto/mbox/tests/qget.at: Likewise. * libproto/mbox/tests/delete.at: Add more tests. * mail/tests/align.at: Fix the expected byte and line count. * mail/tests/hold.at: Likewise. * mail/testsuite/mail/read.exp: Likewise. * mail/testsuite/mail/tag.exp: Likewise. * mail/testsuite/mail/z.exp: Likewise. * mail/tests/copy04.at: Don't use line count and size in comparison. * mail/testsuite/mail/write.exp: Use regexps instead of exact strings for the same reason. * pop3d/testsuite/pop3d/read.exp: Fix the expected byte count. * readmsg/tests/all.at: Expect extra newline in output. * readmsg/tests/hdr.at: Likewise. * readmsg/tests/nohdr.at: Likewise. * readmsg/tests/twomsg.at: Likewise. * readmsg/tests/weed.at: Likewise. * sieve/tests/redirect.at: Fix the expected byte count. * sieve/tests/reject.at: Expect extra newline in output. * mh/inc.c (incmbx): Parse truncate and nomoveto URL parameters prior to opening the mailbox. If notruncate is requested, open the mailbox read-only. * mh/mh_format.c (str_compress_ws): Fix copying between overlapping memory regions. * libtests/Makefile.am: Remove lstuid tests. * libtests/testsuite.at: Likewise. * libtests/lstuid.c: Remove. * libtests/lstuid00.at: Remove. * libtests/lstuid01.at: Remove. * libtests/lstuid02.at: Remove. * libtests/mime.at: Fix the expected byte count. * imap4d/tests/IDEF0956.at: Fix the expected byte count. * map4d/tests/fetch.at: Likewise. * imap4d/tests/append00.at: Remove X-* headers and Status from the mbox prior to comparison. * imap4d/tests/append01.at: Likewise. * libproto/mbox: Remove old code. Replace it with mboxrb. * mail/tests/nohome.at: Update lines/sizes. * mail/testsuite/mail/folder.exp: Likewise. * mail/testsuite/mail/tag.exp: Likewise. * mail/testsuite/mail/z.exp: Likewise. * mda/mda/tests/mda.at: Fix shell quoting. * mda/putmail/tests/putmail.at: Remove extra newline from the expectation. Eliminate X-IMAPbase and X-UID from the resulting mailbox. * mda/tests/mda.sh: Eliminate X-IMAPbase and X-UID from the output. * pop3d/testsuite/pop3d/read.exp: Fix expected lines/sizes * readmsg/tests/hdr.at: Fix extra whitespace. * sieve/tests/action.at: Eliminate X-IMAPbase and X-UID. Fix extra whitespace in the expected From_ line. * sieve/tests/addheader.at: Likewise. * sieve/tests/pipeact.at: Likewise.
2020-09-28Fix last resort return for message_envelope_sender.Sergey Poznyakoff1
* libmailutils/mailbox/msgenv.c (message_envelope_sender): Fix conditional. Use mu_get_user_email instead of tinkering with mu_auth_data. * sieve/tests/moderator.at: Fix expected output.
2020-07-17New test tool: mockmailSergey Poznyakoff5
* testsuite/mockmail.c: New auxiliary tool. * testsuite/.gitignore: Add mockmail. * testsuite/Makefile.am: Build mockmail. * testsuite/mockmta.c: Change docs. * mail/testsuite/mail/send.exp: Use testsuite/mockmail to emulate Sendmail. * mda/mda/tests/forward.at: Likewise. * mh/tests/send.at: Likewise. * mh/tests/testsuite.at: Likewise. * sieve/tests/moderator.at: Likewise. * sieve/tests/redirect.at: Likewise. * sieve/tests/reject.at: Likewise. * sieve/tests/testsuite.at: Likewise. * sieve/tests/vacation.at: Likewise.
2020-06-27sieve: quoted strings may span several linesSergey Poznyakoff2
As per RFC 5228, quoted strings may span several lines and are allowed to contain special characters. Backslash and double-quotes appearing within a quoted string must be escaped by a backslash. A backslash followed by any other character is silently removed. * libmu_sieve/sieve-lex.l (line_addz, str_unescape): Remove. Allow for \n in quoted strings. Escape only " and \ with backslash. Replace unrecognized escapes with the character after \. * sieve/examples/exn-5.4.sv: envelope should not be required. * sieve/tests/compile.at: Add more tests.
2020-02-08Update copyright yearsSergey Poznyakoff36
2019-12-14Fix several linking issuesSergey Poznyakoff1
* configure.ac: Require libtool version 2.4.6 (MU_LINK_POSTFLAGS): Remove. Not needed with the patched version of ltmain.sh. Detect the presencecof GSSAPI. Fix displaying the status of GSSAPI support. Remove the hack introduced on 2010-02-19 (commit 35ac66f056). (MU_AUTHLIBS,SQLLIB) (SQL_LOADABLE_MODULES,SQL_LIBOBJS): Insert spaces only when needed. * mu-aux/ltmain.sh: ltmain.sh from libtool 2.4.6 with fixes from http://gray.gnu.org.ua/public/ltbug installed. * bootstrap.conf (bootstrap_epilogue): Install the fixed ltmain.sh version. * am/gssapi.m4: Allow for "yes" and "probe" argument values. Improve makefile style consistency . Uniformly use parentheses instead of curly braces in variable referencing; . Prefer to use Make variables over substitution variables, for variables prefixed with MU_; * comsat/Makefile.am * dotlock/Makefile.am * examples/Makefile.am * examples/cpp/Makefile.am * frm/Makefile.am * imap4d/Makefile.am * imap4d/tests/Makefile.am * lib/Makefile.am * libmailutils/Makefile.am * libmailutils/address/Makefile.am * libmailutils/auth/Makefile.am * libmailutils/base/Makefile.am * libmailutils/cfg/Makefile.am * libmailutils/cidr/Makefile.am * libmailutils/cli/Makefile.am * libmailutils/datetime/Makefile.am * libmailutils/diag/Makefile.am * libmailutils/filter/Makefile.am * libmailutils/imapio/Makefile.am * libmailutils/list/Makefile.am * libmailutils/locus/Makefile.am * libmailutils/mailbox/Makefile.am * libmailutils/mailcap/Makefile.am * libmailutils/mailer/Makefile.am * libmailutils/mime/Makefile.am * libmailutils/msgset/Makefile.am * libmailutils/opt/Makefile.am * libmailutils/property/Makefile.am * libmailutils/server/Makefile.am * libmailutils/sockaddr/Makefile.am * libmailutils/stdstream/Makefile.am * libmailutils/stream/Makefile.am * libmailutils/string/Makefile.am * libmailutils/tests/Makefile.am * libmailutils/url/Makefile.am * libmailutils/wicket/Makefile.am * libmu_auth/Makefile.am * libmu_cpp/Makefile.am * libmu_dbm/Makefile.am * libmu_scm/Makefile.am * libmu_scm/mailutils/Makefile.am * libmu_sieve/Makefile.am * libmu_sieve/extensions/Makefile.am * libproto/dotmail/Makefile.am * libproto/dotmail/tests/Makefile.am * libproto/imap/Makefile.am * libproto/imap/tests/Makefile.am * libproto/maildir/Makefile.am * libproto/mailer/Makefile.am * libproto/mbox/Makefile.am * libproto/mh/Makefile.am * libproto/nntp/Makefile.am * libproto/pop/Makefile.am * mail/Makefile.am * mapi/Makefile.am * mda/lib/Makefile.am * mda/lmtpd/Makefile.am * mda/mda/Makefile.am * mda/mda/tests/Makefile.am * mda/putmail/Makefile.am * messages/Makefile.am * mh/Makefile.am * mh/tests/Makefile.am * mimeview/Makefile.am * movemail/Makefile.am * mu/Makefile.am * mu/libexec/Makefile.am * pop3d/Makefile.am * python/2/libmu_py/Makefile.am * python/2/mailutils/Makefile.am * python/3/libmu_py/Makefile.am * python/3/mailutils/Makefile.am * readmsg/Makefile.am * sieve/Makefile.am * sql/Makefile.am * testsuite/Makefile.am
2019-11-09Reorganize testsuiteSergey Poznyakoff1
Simplify Makefile.am's in tests subdirectories by moving the common part in a separate file and including it where necessary. Build only one copy of package.m4. Both package.m4 and include file testsuite.am reside in the testsuite directory. Also provide configure options for selecting mda components to build: --disable-build-mda do not build mda --disable-build-lmtpd do not build lmtpd --disable-build-putmail do not build putmail * .gitignore: Update. * Makefile.am [MU_COND_MDA]: Change to MU_COND_MDA_TOOLS * configure.ac: Provide a way to enable/disable building of mda, lmtpd and putmail separately. Build testsuite/package.m4 * testsuite/testsuite.am * testsuite/Makefile.am: Distribute both package.m4.in and package.m4. Include main part from testsuite.am * testsuite/package.m4.in: New file. * comsat/tests/Makefile.am: Include main part from testsuite.am * frm/tests/Makefile.am: Likewise. * imap4d/tests/Makefile.am: Likewise. * libmailutils/tests/Makefile.am: Likewise. * libmu_scm/tests/Makefile.am: Likewise. * libproto/dotmail/tests/Makefile.am: Likewise. * mail/tests/Makefile.am: Likewise. * messages/tests/Makefile.am: Likewise. * mh/tests/Makefile.am: Likewise. * mimeview/tests/Makefile.am: Likewise. * readmsg/tests/Makefile.am: Likewise. * sieve/tests/Makefile.am: Likewise. * mda/.gitignore: Remove. * mda/tests/Makefile.am: Remove. * mda/tests/testsuite.at: Remove. * mda/tests/.gitignore: Remove. * mda/tests/atlocal.in: Remove. * mda/tests/mda.inc: New file. * mda/Makefile.am: Add extra directory level. Add subdirs depending on whether the corresponding component is selected for building. * mda/lmtpd/.gitignore: New file. * mda/lmtpd/Makefile.am: New file. * mda/lmtpd.c: Move to mda/lmtpd/lmtpd.c * mda/lmtpd/tests/.gitignore: New file. * mda/lmtpd/tests/Makefile.am: New file. * mda/lmtpd/tests/atlocal.in: New file. * mda/tests/lmtpd.at: Move to mda/lmtpd/tests/lmtpd.at * mda/lmtpd/tests/testsuite.at: New file. * mda/mda/.gitignore: New file. * mda/mda/Makefile.am: New file. * mda/mda.c: Move to mda/mda/mda.c * mda/mda/tests/.gitignore: New file. * mda/mda/tests/Makefile.am: New file. * mda/mda/tests/atlocal.in: New file. * mda/tests/forward.at: Move to mda/mda/tests/forward.at * mda/tests/mda.at: Move to mda/mda/tests/mda.at * mda/mda/tests/testsuite.at: New file. * mda/putmail/.gitignore: New file. * mda/putmail/Makefile.am: New file. * mda/putmail.c: Move to mda/putmail/putmail.c * mda/putmail/tests/.gitignore: New file. * mda/putmail/tests/Makefile.am: New file. * mda/putmail/tests/atlocal.in: New file. * mda/tests/putmail.at: Move to mda/putmail/tests/putmail.at * mda/putmail/tests/testsuite.at: New file * po/POTFILES.in: Update pathnames * maint/fullcheck.mk: Minor fixes.
2019-02-26New autoconf macro for activating mailbox format supportSergey Poznyakoff1
* am/enable.m4 (MU_ENABLE_SUPPORT) (MU_ENABLE_BUILD): Use m4_-prefixed directives. (MU_ENABLE_MAILBOX_FORMAT) (MU_ENABLE_LOCAL_MAILBOX_FORMAT_ (MU_ENABLE_REMOTE_MAILBOX_FORMAT): New macros. (MU_LIB_MAILBOX) (MU_LIB_LOCAL_MAILBOX) (MU_LIB_REMOTE_MAILBOX): New substitution variables. * configure.ac: Use new macros to enable mailbox formats * libproto/Makefile.am: Augment SUBDIRS instead of using Makefile variables. * comsat/Makefile.am: Use MU_LIB_.*MAILBOX macros to link in the necessary libraries. * examples/Makefile.am: Likewise. * examples/cpp/Makefile.am: Likewise. * frm/Makefile.am: Likewise. * imap4d/Makefile.am: Likewise. * include/mailutils/sys/Makefile.am: Likewise. * libmu_scm/Makefile.am: Likewise. * libproto/Makefile.am: Likewise. * maidag/Makefile.am: Likewise. * mail/Makefile.am: Likewise. * messages/Makefile.am: Likewise. * mh/Makefile.am: Likewise. * movemail/Makefile.am: Likewise. * mu/libexec/Makefile.am: Likewise. * pop3d/Makefile.am: Likewise. * python/2/libmu_py/Makefile.am: Likewise. * python/3/libmu_py/Makefile.am: Likewise. * readmsg/Makefile.am: Likewise. * sieve/Makefile.am: Likewise. * testsuite/Makefile.am: Likewise.
2019-01-03Update copyright yearsSergey Poznyakoff36
2018-10-24sieve: set variables from command lineSergey Poznyakoff2
The new command line option --variable initializes the RFC 5229 variable. * NEWS: Update. * doc/texinfo/programs.texi: Fix description of sieve command line options. * include/mailutils/sieve.h (mu_sieve_variable_initialize): New proto. * libmu_sieve/runtime.c (sieve_run): Call mu_i_sv_init_variables to clear and initialize the table of variables. * libmu_sieve/sieve-gram.y (mu_sieve_machine_dup): Copy variables. (mu_sieve_machine_destroy): Destroy table of variables and initializer list. * libmu_sieve/sieve-priv.h (mu_sieve_machine) <init_var>: New member. (mu_sieve_variable_initializer): New type. (mu_i_sv_init_variables): New proto. * libmu_sieve/variables.c (mu_sieve_variable_initialize): New function. (mu_i_sv_copy_variables): Copy initializers as well. (mu_i_sv_init_variables): New function. * sieve/sieve.c: New command line option --variable. * sieve/tests/variables.at: Test the --variable option.
2018-01-19Version 3.4.90; update copyright yearsSergey Poznyakoff36
2017-06-14Provide backward compatibility layer for deprecated functions.Sergey Poznyakoff1
* include/mailutils/sieve.h (mu_sieve_compile_text): New proto. (mu_sieve_compile_buffer): Backward-compatible proto. * include/mailutils/stream.h ((MU_IOCTL_LOGSTREAM_GET_LOCUS_DEPRECATED) (MU_IOCTL_LOGSTREAM_SET_LOCUS_DEPRECATED): New defines. (MU_IOCTL_LOGSTREAM_GET_LOCUS) (MU_IOCTL_LOGSTREAM_SET_LOCUS): Use external functions to make sure any references to these are marked as deprecated. * include/mailutils/types.hin (mu_locus_DEPRECATED): New struct. (mu_locus): Define to mu_locus_DEPRECATED * libmailutils/stream/logstream.c (_log_ctl): Handle the deprecated ctls. * libmu_sieve/extensions/moderator.c (moderator_filter_message): Use mu_sieve_compile_text. * libmu_sieve/sieve-gram.y (mu_sieve_compile_buffer): Rename to mu_sieve_compile_text. Re-introduce it as a backward-compatibility API. * sieve/sieve.c: Call mu_sieve_compile_text instead of mu_sieve_compile_buffer.
2017-06-13Try to display exact error locations in Sieve diagnosticsSergey Poznyakoff1
* include/mailutils/sieve.h (mu_sieve_value_t)<locus>: New field. * libmu_sieve/util.c (mu_sieve_value_create): Take a pointer to mu_locus_range. Use it to initialize the locus field. * libmu_sieve/sieve-gram.y: Pass loci in calls to mu_sieve_value_create. * libmu_sieve/actions.c: Use the most specific locus when displaying the message. * libmu_sieve/comparator.c: Likewise. * libmu_sieve/prog.c: Likewise. * libmu_sieve/variables.c: Likewise. * sieve/tests/i-numeric.at: Update the expected error location.
2017-06-13Switch to new locus typesSergey Poznyakoff2
* include/mailutils/types.hin (mu_locus): Remove. * include/mailutils/diag.h (mu_diag_at_locus): Remove. (mu_diag_at_locus_point,mu_diag_at_locus_range): New protos. * include/mailutils/mailutils.h: Include locus.h * include/mailutils/stream.h (MU_IOCTL_LOGSTREAM_GET_LOCUS) (MU_IOCTL_LOGSTREAM_SET_LOCUS): Remove. * libmailutils/stream/logstream.c (_log_ctl): Reflect this. * libmailutils/tests/logstr.at: Remove the related test. * libmailutils/tests/logstr.c: Ditto. * libmailutils/cfg/Makefile.am: Add new header. * libmailutils/cfg/cfg.h: New file. * libmailutils/cfg/format.c: Use mu_locus_range * libmailutils/cfg/lexer.l: Use the mu_linetrack facility * libmailutils/cfg/parser.y: LIkewise. * libmailutils/diag/diag.c (mu_diag_at_locus): Remove. (mu_diag_at_locus_point,mu_diag_at_locus_range): New protos. * comsat/action.c: Use mu_locus_point and mu_locus_range instead of the removed mu_locus. * include/mailutils/auth.h: Likewise. * include/mailutils/cfg.h: Likewise. * include/mailutils/sieve.h: Likewise. * libmailutils/base/wicket.c: Likewise. * libmailutils/tests/wicket.c: Likewise. * libmu_auth/radius.c: Likewise. * libmu_sieve/actions.c: Likewise. * libmu_sieve/comparator.c: Likewise. * libmu_sieve/extensions/moderator.c: Likewise. * libmu_sieve/mem.c: Likewise. * libmu_sieve/prog.c: Likewise. * libmu_sieve/require.c: Likewise. * libmu_sieve/runtime.c: Likewise. * libmu_sieve/sieve-priv.h: Likewise. * libmu_sieve/sieve.l: Use the mu_linetrack facility. * libmu_sieve/sieve.y: Likewise. * libmu_sieve/util.c: Use mu_locus_point and mu_locus_range instead of the removed mu_locus * libmu_sieve/variables.c: Likewise. * mail/source.c: Likewise. * mu/libexec/dbm.c: Likewise. * mu/libexec/logger.c: Likewise. * mu/libexec/wicket.c: Likewise. * sieve/sieve.c: Likewise. * sieve/tests/i-numeric.at: Update expected locations
2017-06-07Fix logstream to support mu_locus_range.Sergey Poznyakoff1
* include/mailutils/locus.h (mu_stream_print_locus_range) (mu_stream_vlprintf, mu_stream_lprintf, mu_lrange_debug): New protos. * include/mailutils/stream.h (MU_IOCTL_LOGSTREAM_GET_LOCUS_RANGE) (MU_IOCTL_LOGSTREAM_SET_LOCUS_RANGE): New ioctls. * include/mailutils/sys/logstream.h (_mu_log_stream): Replace locus with struct mu_locus_range locrange. * libmailutils/locus/debug.c: Rewrite. * libmailutils/locus/ident.c (mu_ident_ref): Accept NULL argument. Fix initialization. (mu_ident_deref): Accept NULL argument. * libmailutils/stream/logstream.c: Rewrite. * libmailutils/tests/.gitignore: Update. * libmailutils/tests/Makefile.am: Add new tests. * libmailutils/tests/testsuite.at: Likewise. * libmailutils/tests/logstr.at: New testcase. * libmailutils/tests/logstr.c: New file. * libmailutils/tests/xscript.at: Minor change. * sieve/tests/i-numeric.at: Minor change.
2017-04-18Fix semantics of mu_header_set_value and creation of multipart/alternative MIMESergey Poznyakoff4
Until now, mu_header_set_value called with replace=0 prepended the header to the header list, if a header with such name was already present. This has been changed. Now, if the header with the requested name is already present, its action is as follows: 1. If repl is 0, return MU_ERR_EXISTS 2. Otherwise, replace the header with the new value. If the header is not present, it is appended to the end of the header list, instead of putting it at the beginning. This change is incompatible and breaks the tests, that relied on a particular field ordering. These are fixed as well. The use of mu_header_set_value throughout the sources has been revised to ensure that single-instance headers are never added twice. This change also facilitates the second part of this commit, which fixes creation of the multipart/alternative message by the mail utility. * libmailutils/mailbox/header.c (mu_header_set_value): Fix semantics. If the replace parameter is not set and the header field with the given name already exists, return MU_ERR_EXISTS without changing anything. If adding new header, append it to the end of the header list, instead of pushing it to the top. * configure.ac: Raise shared library revision number. * libmu_scm/mu_message.c (mu-message-set-header) (mu-message-set-header-fields): call mu_header_set_value explicitly if repl is not set. * libmu_sieve/extensions/moderator.c: Force replace header mode when needed. * libmu_sieve/extensions/vacation.c: Likewise. * mh/mh_init.c (mh_annotate): Prepend the annotation header. * mh/mhn.c: Force replace header mode when needed. * mh/repl.c: Likewise. * mh/send.c: Likewise. * libmailutils/tests/modmesg01.at: Change expected header order. * libmailutils/tests/modmesg03.at: Likewise. * mh/tests/mhn.at: Likewise. * mh/tests/send.at: Likewise. * sieve/tests/moderator.at: Likewise. * sieve/tests/redirect.at: Likewise. * sieve/tests/reject.at: Likewise. * sieve/tests/vacation.at: Likewise. * examples/mta.c (message_finalize): Append X-Authentication-Warning, instead of setting it. Make sure Content-Disposition is not set for parts of a multipart/ alternative MIME message. Some mail readers (notably, yahoo), misinterpret it. * libmailutils/mime/attachment.c (at_hdr): Use mu_header_set_value to set Content-Type and Content-Disposition. * libmailutils/mime/mime.c (_mime_set_content_type): If the content type is set to multipart/alternative, remove the Content-Disposition headers from the message parts. * mail/send.c (saveatt): Don't set content-disposition for multipart/alternative, it is now done by the library. (add_attachments): Warn about ignored headers. Append only Received and X-* headers, replace others. (parse_headers): Append headers. (compose_header_set): Use mu_header_append if COMPOSE_APPEND is requested. * mail/util.c (util_header_expand): Use mu_header_append.
2017-02-05Remove unneeded fileSergey Poznyakoff1
* sieve/examples/.gitignore: Remove.
2017-01-01Happy GNU YearSergey Poznyakoff36
2016-12-19BugfixesSergey Poznyakoff1
* configure.ac: Fallback to guile installation prefix, if 'guile-config info bindir' returns empty string. * doc/texinfo/programs.texi: Minor fix. * mail/mailline.c (ml_readline_init): Don't use obsolete CPPFunction type. * mu/shell.c (mutool_initialize_readline): Likewise. * scheme/sieve2scm.scmi: Fix typo. * sieve/sieve.c (main): Fix initialization of Sieve environment variables "location" and "post".
2016-12-13BugfixesSergey Poznyakoff1
* libmu_sieve/sieve.y: Fix compilation of chained elsif conditions. * sieve/sieve.c: Define the location environment item.
2016-12-13Document changes to SieveSergey Poznyakoff2
* NEWS: Update. * doc/texinfo/libmu_sieve.texi: Update. * doc/texinfo/sieve.texi: Document extensions * libmu_sieve/comparator.c (mu_sieve_match_part_checker): Check the type of the 2nd argument. * sieve/sieve.c: Define "location" and "phase" environment items. * sieve/tests/pipetest.at: Use "pipe" as the capability string.
2016-12-12Add tests for sieve environment. Initialize environment in maidag and incSergey Poznyakoff3
* sieve/tests/environment.at: New testcase. * sieve/tests/Makefile.am: Add new file. * sieve/tests/testsuite.at: Include new file. * lib/muscript.h (mu_script_init): Change signature. * lib/muscript_priv.h (mu_script_fun) <script_init>: Likewise. * lib/guile.c (scheme_init): Update. * lib/python.c (python_init): Update. * lib/script.c (mu_script_init): Pass environment to the script_init method. * lib/sieve.c (sieve_init): Set sieve environment. * maidag/script.c (apply_script): Set environment. * mh/inc.c: Likewise.
2016-12-11Support for environment extension (RFC 5183).Sergey Poznyakoff1
* include/mailutils/sieve.h (mu_sieve_require_environment): New proto. * libmu_sieve/Makefile.am: Add environment.c * libmu_sieve/environment.c: New file. * libmu_sieve/require.c: Handle "environment" keyword. * libmu_sieve/sieve-priv.h (mu_sieve_machine) <exenv>: New member. * libmu_sieve/sieve.l: Bugfixes * libmu_sieve/variables.c: Add missing static qualifiers * sieve/sieve.c: New option --environment
2016-12-08Fix eventual dangling pointersSergey Poznyakoff1
Don't set mu_log_tag, leave that to the caller. * libmailutils/cli/cli.c (mu_cli_ext): Don't set mu_log_tag. * libmailutils/stdstream/strerr.c: Use MU_LOG_TAG macro from syslog.h * sieve/sieve.c: Redo --no-program-name support
2016-12-07Implement the "variables" Sieve extension (RFC 5229)Sergey Poznyakoff3
* include/mailutils/sieve.h (mu_sieve_string): New fields "constant" and "changed". (mu_sieve_match_part_tags): New extern. (mu_sieve_relational_count) (mu_sieve_require_variables) (mu_sieve_has_variables) (mu_sieve_string_get): New functions. * libmu_sieve/variables.c: New file. * libmu_sieve/Makefile.am: Add variables.c * libmu_sieve/comparator.c: Use mu_sieve_string_get to obtain the actual value of the string. * libmu_sieve/require.c: Support the "variables" extension. * libmu_sieve/sieve-priv.h (mu_sieve_machine): New fields vartab, match_string, match_buf, match_count, match_max. (mu_i_sv_copy_variables) (mu_i_sv_expand_variables): New protos. * libmu_sieve/sieve.l (line_add): zero length means add entire asciiz string. * libmu_sieve/sieve.y (mu_sieve_machine_reset): Reset the new fields. (mu_sieve_machine_clone): Copy variables and initialize new fields. (string_rescan): New function. (sieve_parse): Rescan string to determine their properties. * libmu_sieve/strexp.c (update_len): Allow for NULL replacement values. * libmu_sieve/string.c (mu_sieve_string_get): New function. (mu_sieve_string): Use it. * libmu_sieve/tests.c (do_count): Rename to mu_sieve_relational_count, make global. All uses changed. (match_part_tags): Rename to mu_sieve_match_part_tags, make global. All uses changed. * sieve/tests/variables.at: New file. * sieve/tests/Makefile.am: Add new testcases. * sieve/tests/testsuite.at: Likewise.
2016-12-03Rename mu_sieve_machine_init to mu_sieve_machine_createSergey Poznyakoff1
2016-12-02sieve: change string allocation and argument passing conventionSergey Poznyakoff2
Strings are allocated in a per-machine string space. String and argument lists form contiguous arrays of structures. Regular ex- pressions are compiled when they are needed. Compiled expressions are cached for eventual reuse.
2016-11-25Implement RFC 5228, 2.4.2.4 (Encoding Characters Using "encoded-character")Sergey Poznyakoff3
* libmu_sieve/encoded.c: New file. * libmu_sieve/strexp.c: New file. * libmu_sieve/Makefile.am: Add new files. * libmu_sieve/require.c (mu_sieve_require): Understand "encoded-character". * libmu_sieve/sieve-priv.h (mu_i_sv_interp_t): New typedef. (mu_i_sv_expand_encoded_char): New proto. (mu_sieve_require_encoded_character): New proto. * libmu_sieve/sieve.l (string): Rewrite via line_.* functions. This fixes memory leaks on mu_sieve_machine_destroy. (line_finish): Expand ${} sequences before returning. (mu_sieve_require_encoded_character): New function. * sieve/tests/enc-char.at: New file. * sieve/tests/Makefile.am: Add enc-char.at * sieve/tests/testsuite.at: Likewise.
2016-11-24sieve: simplify action logging APISergey Poznyakoff1
* include/mailutils/sieve.h (mu_sieve_action_log_t): Change proto. * lib/sieve.c (_sieve_action_log): Rewrite. * libmu_sieve/util.c (mu_sieve_log_action): Rewrite. * python/libmu_py/sieve.c (_sieve_action_printer): Rewrite. * sieve/sieve.c (_sieve_action_log): Rewrite.
2016-11-24sieve: provide a separate stream for debugging outputSergey Poznyakoff1
* include/mailutils/sieve.h (MU_SIEVE_DEBUG_TRACE) (MU_SIEVE_DEBUG_INSTR,MU_SIEVE_DEBUG_DISAS) (MU_SIEVE_DRY_RUN): Remove. (mu_sieve_machine_init_ex): Remove proto. (mu_sieve_set_dbg_stream,mu_sieve_get_dbg_stream) (mu_sieve_stream_save) (mu_sieve_stream_restore): New protos. * libmu_sieve/runtime.c (INSTR_DISASS,INSTR_DEBUG): Reimplement. * libmu_sieve/sieve-priv.h (MU_SV_SAVED_ERR_STATE) (MU_SV_SAVED_DBG_STATE,MU_SV_SAVED_STATE): New bitflags. (mu_sieve_state_disass): New constant. (mu_sieve_machine)<state_flags, err_mode> <err_locus,dbg_mode,dbg_locus>: New members. <dbgstream>: New member. * libmu_sieve/sieve.y (mu_sieve_machine_init_ex): Remove. (mu_sieve_machine_dup, mu_sieve_machine_inherit): Fix. (mu_sieve_set_dbg_stream) (mu_sieve_get_dbg_stream): New functions. (mu_sieve_machine_destroy): Destroy dbgstream. (with_machine): Preserve stream state (mode & locus). * libmu_sieve/util.c (mu_i_sv_debug,mu_i_sv_debug_command): Use ioctl instead of format strings. (mu_sieve_stream_save, mu_sieve_stream_restore): New functions. * python/libmu_py/sieve.c (api_sieve_machine_init): Use mu_sieve_machine_init. * sieve/sieve.c: Improve help output. (main): Dump disassembled code to standard output.
2016-11-23Fix typoSergey Poznyakoff1
2016-11-23Redo sieve debugging supportSergey Poznyakoff2
Instead of keeping individual debug flags for each Sieve machine, use global debugging mechanism, category "sieve". The following levels are defined: trace1 - print parse tree before optimization trace2 - print parse tree after optimization trace3 - print parser traces trace4 - print tests and actions being executed trace8 - print disassembled code, don't run trace9 - print each Sieve instruction being executed * include/mailutils/sieve.h (mu_sieve_get_debug_level) (mu_sieve_set_debug_level): Remove. (mu_sieve_is_dry_run,mu_sieve_set_dry_run * lib/script.c (mu_script_debug_flags): Redo. * lib/sieve.c (sieve_init): Remove call to obsoleted mu_sieve_set_debug_level. * examples/numaddr.c: Use mu_sieve_trace * libmu_sieve/extensions/list.c: Likewise. * libmu_sieve/extensions/moderator.c: Likewise. * libmu_sieve/extensions/pipe.c: Likewise. * libmu_sieve/extensions/spamd.c: Likewise. * libmu_sieve/extensions/timestamp.c: Likewise. * libmu_sieve/extensions/vacation.c: Likewise. * libmu_sieve/tests.c: Likewise. * libmu_sieve/runtime.c (INSTR_DEBUG,INSTR_DISASS): Rewrite. (mu_sieve_get_debug_level): Remove. (mu_sieve_is_dry_run_: Rewrite. (mu_sieve_set_dry_run): New function. (mu_sieve_disass): Rewrite. * libmu_sieve/sieve-priv.h (mu_sieve_machine) <debug_level>: Remove. <dry_run>: New field. * libmu_sieve/sieve.y (mu_sieve_set_debug_level): Remove. * libmu_sieve/util.c (mu_sieve_trace): New function. * sieve/sieve.c: Rewrite support for --dry-run and --debug. * sieve/tests/ext.at: Use --libdir-prefix instead of -L
2016-11-23Rewrite sieve parser.Sergey Poznyakoff2
Three objectives: 1. Simplify code. 2. Produce optimized sieve code. 3. Improve error reporting. 4. Prepare for further extensions * include/mailutils/sieve.h (mu_sieve_tag_checker_t): Change signature (take mu_sieve_machine_t as the first arg). All uses changed. (mu_sieve_require): Likewise. (mu_sieve_yydebug): Remove global. * libmu_sieve/sieve-priv.h (mu_locus_range): New struct. (YYLTYPE): New define (mu_sieve_state): New enum. (mu_sieve_machine): New members: string_pool, state. (mu_sieve_node_type): New enum. (mu_sieve_node): New struct. Remove unused prototypes. * libmu_sieve/sieve.l: Keep track of code locations. Use opool for constructing string values. * libmu_sieve/sieve.y: Rewrite. First build the parse tree. Then optimize it. Finally, generate code. * libmu_sieve/tests.c (sieve_test_true,sieve_test_false): Remove. True and false tests are always optimized away. * libmu_sieve/util.c (mu_sv_compile_error): Remove. * libmu_sieve/actions.c: Use mu_diag_at_locus to report errors and mu_i_sv_error to mark sieve machine as being in error state. * libmu_sieve/comparator.c: Likewise. * libmu_sieve/prog.c (mu_sv_code): Replace with mu_i_sv_code. (mu_sv_code_instr,mu_sv_code_handler) (mu_sv_code_list,mu_sv_code_number) (mu_sv_code_string,mu_sv_code_source) (mu_sv_code_line,mu_sv_change_source) (mu_sv_code_action,mu_sv_code_test) (mu_sv_code_anyof,mu_sv_code_allof): Remove. (mu_i_sv_locus,mu_i_sv_code_action) (mu_i_sv_code_test): New function. (mu_sv_code_command): Replace with a static function. * libmu_sieve/require.c (mu_sieve_require): Take ptr to machine as the first arg. * libmu_sieve/runtime.c (mu_sieve_mailbox) (mu_sieve_message): Refuse to run if the machine is in error state. * sieve/sieve.c: Update. * sieve/tests/i-numeric.at: Update expected error message. * libmailutils/diag/diag.c (mu_diag_at_locus): Don't pass locus if mu_file is NULL. * libmu_auth/ldap.c (_mu_entry_to_auth_data): Remove leftover mu_error.
2016-11-02Rename default configuration fileSergey Poznyakoff1
The default configuration file name is "mailutils.conf". Legacy configuration file "mailutils.rc" is processed if necessary. * libmailutils/cli/cli.c: Rename main configuration file to mailutils.conf Remove 'rcfile' option aliases. (mu_cli_ext): Special handling for legacy configuration file. * NEWS: Update. * doc/texinfo/mailutils.texi: Update. * doc/texinfo/programs.texi: Update.
2016-10-29Minor changesSergey Poznyakoff1
2016-10-29Remove left over references to argp; other bugfixesSergey Poznyakoff1
2016-10-19Rename MU_APP_NEW_LIBRARIES back to MU_APP_LIBRARIES. Version 2.99.991.Sergey Poznyakoff1
2016-10-19Convert remaining utilities (except mh) to mu_cli.Sergey Poznyakoff1
* Makefile.am: Remove libmu_argp and libmu_cfg * configure.ac: Likewise. * libmu_argp/: Remove. * libmu_cfg/: Remove. * include/mailutils/Makefile.am (pkginclude_HEADERS): Remove gocs.h, libargp.h, libcfg.h * frm/frm.c: Register tls auth module * frm/from.c: Likewise. * maidag/maidag.c: Likewise. * mail/mail.c: Likewise. * messages/messages.c: Likewise. * movemail/movemail.c: Likewise. * readmsg/readmsg.c: Likewise. * sieve/sieve.c: Likewise. * frm/frm.h: Remove obsolete includes * imap4d/Makefile.am: Update. * imap4d/imap4d.c: Use mu_cli for command line and configuration parsing. * imap4d/imap4d.h: Update. * include/mailutils/gocs.h: Remove. * libmailutils/cfg/gocs.c: Remove. * libmailutils/cfg/Makefile.am: Remove gocs.c * include/mailutils/cli.h (mu_cli_capa_apply): Rename to mu_cli_capa_extend_settings (mu_cli_setup) <inorder, prog_doc_hook>: New fields. * include/mailutils/daemon.h: Remove obsolete includes. * include/mailutils/gsasl.h: Likewise. * include/mailutils/mailutils.h: Update. * include/mailutils/mu_auth.h (mu_auth_mode): New enum (mu_auth_module): Redo structure. * include/mailutils/opt.h (mu_parseopt) <po_prog_doc_hook>: New field. * include/mailutils/sql.h (mu_sql_module_config): New extern. (mu_sql_interface_index): Change proto. * libmailutils/auth/mu_auth.c: Rewrite. * libmailutils/auth/system.c (mu_auth_system_module): Update structure * libmailutils/cli/capa.c (mu_cli_capa_apply): Rename to mu_cli_capa_extend_settings * libmailutils/cli/cli.c: Extend settings from auth modules as well. * libmailutils/opt/help.c (mu_program_help): Invoke po_prog_doc_hook if defined. * libmailutils/opt/opt.c (parseopt_init): Check the MU_PARSEOPT_PROG_DOC_HOOK flag. (find_long_option): Fix recognition of ambiguous options in case of exact match. * libmu_auth/gsasl.c: Add configuration. * libmu_auth/ldap.c: Likewise. * libmu_auth/pam.c: Likewise. * libmu_auth/radius.c: Likewise. * libmu_auth/sql.c: Likewise. * libmu_auth/tls.c: Likewise. * libmu_auth/virtual.c: Likewise. * mu/Makefile.am: Update. * mu/mu.c: Rewrite using mu_cli * mu/mu.h: Likewise. * mu/acl.c: Likewise. * mu/cflags.c: Likewise. * mu/dbm.c: Likewise. * mu/dispatch.c: Likewise. * mu/filter.c: Likewise. * mu/flt2047.c: Likewise. * mu/getans.c: Likewise. * mu/getarg.c: Likewise. * mu/getyn.c: Likewise. * mu/help.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/shell.c: Likewise. * mu/smtp.c: Likewise. * mu/util.c: Likewise. * mu/verbose.c: Likewise. * mu/wicket.c: Likewise. * pop3d/Makefile.am: Update. * pop3d/pop3d.c: Convert to mu_cli interface. * pop3d/pop3d.h: Likewise. * sql/sql.c (mu_sql_interface_index): Change argument qualifiers.
2016-10-16Allow for multiple argument sets in help output.Sergey Poznyakoff1
Alternative invocations follow the main one, each on a separate line, preceded by " or: ". * include/mailutils/cli.h (mu_cli_setup) <prog_alt_args>: New member. * include/mailutils/opt.h (mu_parseopt) <po_prog_args>: Change type. (mu_program_usage): Change signature. * include/mailutils/stream.h (MU_IOCTL_WORDWRAP_GET_OFFSET): Rename to MU_IOCTL_WORDWRAP_GET_COLUMN. All uses changed. * libmailutils/cli/cli.c (mu_cli): Construct po.po_prog_args from prog_args and prog_alt_args. * libmailutils/opt/help.c (move_margin): Remove. (print_program_usage): New static function. (mu_program_usage): Second argument instructs how to display options. Main work is done by print_program_usage. (mu_program_help): Call print_program_usage. * libmailutils/opt/opt.c: Update. * libmailutils/stream/wordwrap.c (set_margin): Avoid unnecessary flushes. * libmailutils/tests/parseopt.c (MU_PARSEOPT_PROG_ARGS): Alternative argument sets are separated by the pipe sign. * libmailutils/tests/Makefile.am: Add new testcase. * libmailutils/tests/testsuite.at: Likewise. * libmailutils/tests/parseopt_help04.at: Add MU_PARSEOPT_PROG_ARGS to keywords. * libmailutils/tests/parseopt_help12.at: New file. * libmailutils/tests/tcli.c (cli): Add alternative arguments. * dotlock/dotlock.c: Update. * mimeview/mimeview.c: Likewise. * sieve/sieve.c: Likewise.
2016-10-12Fix some incompatibilities in the previous commit.Sergey Poznyakoff1
* dotlock/dotlock.c (force): Change type to unsigned. Provide default value for --force. (cli): Set exit codes and extra docstring. * include/mailutils/cli.h (mu_cli_setup): New members: prog_extra_doc, ex_usage, ex_config. * include/mailutils/opt.h (mu_parseopt_getcolumn) (mu_parseopt_fmt_text): New prototypes. * libmailutils/cli/cli.c (extra_help_hook): New hook. (mu_cli): Set up customized exit codes. Pass pointer to struct mu_cli_setup in hints.data. All uses changed. Set up help hook if setup->prog_extra_doc is defined. * libmailutils/opt/help.c (mu_parseopt_getcolumn): New function. (print_option_descr): Honor explicit newlines. (mu_parseopt_fmt_text): New function. * mimeview/mimeview.c (cli): Provide extra docs. * sieve/sieve.c: Likewise.
2016-10-12Convert to mu_cli: frm, from, messages, mimeview, movemail, readmsg, sieveSergey Poznyakoff2
* configure.ac (MU_APP_NEW_LIBRARIES): New temp variable. * include/mailutils/sieve.h (mu_cli_capa_sieve): New extern. * include/mailutils/tls.h (mu_cli_capa_tls): New extern. * libmailutils/cli/cli.c: Minor change. * libmailutils/cli/stdcapa.c: Add "auth" capability. * libmu_auth/tls.c: provide mu_cli_capa_tls * dotlock/Makefile.am: Link with MU_APP_NEW_LIBRARIES * dotlock/dotlock.c * frm/Makefile.am: Link with MU_APP_NEW_LIBRARIES * frm/frm.h: Fix includes. * frm/frm.c: Use mu_cli for optionr&config parsing. * frm/from.c: Likewise. * messages/Makefile.am: Link with MU_APP_NEW_LIBRARIES * messages/messages.c: Use mu_cli for optionr&config parsing. * mimeview/Makefile.am: Link with MU_APP_NEW_LIBRARIES * mimeview/mimeview.c: Use mu_cli for optionr&config parsing. * movemail/Makefile.am: Link with MU_APP_NEW_LIBRARIES * movemail/movemail.c: Use mu_cli for optionr&config parsing. * readmsg/Makefile.am: Link with MU_APP_NEW_LIBRARIES * readmsg/readmsg.c: Use mu_cli for optionr&config parsing. * sieve/Makefile.am: Link with MU_APP_NEW_LIBRARIES * sieve/sieve.c: Use mu_cli for optionr&config parsing.
2016-10-08Use mu_c_type_t throughout the code. Get rid of mu_cfg_param_data_type.Sergey Poznyakoff1
* include/mailutils/cfg.h (mu_cfg_param_data_type): Remove. (mu_cfg_param_type): New enum. (mu_cfg_param) <type>: Change type to int. (mu_cfg_cidr): Remove. (mu_cfg_parse_boolean): Remove. All uses updated. * include/mailutils/util.h (mu_c_void): New constant. (mu_c_type_str): New extern/ * libmailutils/string/str_to_c.c (mu_c_type_str): New global. * libmailutils/cfg/format.c (mu_cfg_data_type_string): Rename to mu_c_type_string; change argument type. All uses updated. * libmailutils/cfg/parser.y: Use mu_str_to_c for value conversion. * libmailutils/tests/.gitignore: Update. * libmailutils/tests/Makefile.am: Add strtoc.at; build strtoc * libmailutils/tests/strtoc.at: New file. * libmailutils/tests/strtoc.c: New file. * libmailutils/tests/testsuite.at: Include strtoc.at * comsat/comsat.c: Use mu_c_type_t types. * dotlock/dotlock.c: Likewise. * imap4d/imap4d.c: Likewise. * lib/manlock.c: Likewise. * lib/tcpwrap.c: Likewise. * libmailutils/server/msrv.c: Likewise. * libmu_argp/muinit.c: Likewise. * libmu_cfg/common.c: Likewise. * libmu_cfg/gsasl.c: Likewise. * libmu_cfg/ldap.c: Likewise. * libmu_cfg/pam.c: Likewise. * libmu_cfg/radius.c: Likewise. * libmu_cfg/sieve.c: Likewise. * libmu_cfg/sql.c: Likewise. * libmu_cfg/tls.c: Likewise. * libmu_cfg/virtdomain.c: Likewise. * maidag/maidag.c: Likewise. * mimeview/mimeview.c: Likewise. * movemail/movemail.c: Likewise. * pop3d/pop3d.c: Likewise. * readmsg/readmsg.c: Likewise. * sieve/sieve.c: Likewise.

Return to:

Send suggestions and report system problems to the System administrator.