Hello community, here is the log from the commit of package dovecot23 for openSUSE:Factory checked in at 2019-07-26 12:40:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/dovecot23 (Old) and /work/SRC/openSUSE:Factory/.dovecot23.new.4126 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "dovecot23" Fri Jul 26 12:40:22 2019 rev:19 rq:718437 version:2.3.7.1 Changes: -------- --- /work/SRC/openSUSE:Factory/dovecot23/dovecot23.changes 2019-05-02 19:18:38.661562344 +0200 +++ /work/SRC/openSUSE:Factory/.dovecot23.new.4126/dovecot23.changes 2019-07-26 12:40:23.853906983 +0200 @@ -1,0 +2,72 @@ +Tue Jul 23 20:06:59 UTC 2019 - Michael Ströder <[email protected]> + +- update to 2.3.7.1 and pigeonhole to 0.5.7.1 + Dovecot 2.3.7.1 + - Fix TCP_NODELAY errors being logged on non-Linux OSes + - lmtp proxy: Fix assert-crash when client uses BODY=8BITMIME + - Remove wrongly added checks in namespace prefix checking + Pigeonhole 0.5.7.1 + - dsync: Sieve script syncing failed if mailbox attributes weren't enabled. + Dovecot 2.3.7 + * fts-solr: Removed break-imap-search parameter + + Added more events for the new statistics, see + https://doc.dovecot.org/admin_manual/list_of_events/ + + mail-lua: Add IMAP metadata accessors, see + https://doc.dovecot.org/admin_manual/lua/ + + Add event exporters that allow exporting raw events to log files and + external systems, see + https://doc.dovecot.org/configuration_manual/event_export/ + + SNIPPET is now PREVIEW and size has been increased to 200 characters. + + Add body option to fts_enforced. This triggers building FTS index only + on body search, and an error using FTS index fails the search rather + than reads through all the mails. + - Submission/LMTP: Fixed crash when domain argument is invalid in a + second EHLO/LHLO command. + - Copying/moving mails using Maildir format loses IMAP keywords in the + destination if the mail also has no system flags. + - mail_attachment_detection_options=add-flags-on-save caused email body + to be unnecessarily opened when FETCHing mail headers that were + already cached. + - mail attachment detection keywords not saved with maildir. + - dovecot.index.cache may have grown excessively large in some + situations. This happened especially when using autoexpunging with + lazy_expunge folders. Also with mdbox format in general the cache file + wasn't recreated as often as it should have. + - Autoexpunged mails weren't immediately deleted from the disk. Instead, + the deletion from disk happened the next time the folder was opened. + This could have caused unnecessary delays if the opening was done by + an interactive IMAP session. + - Dovecot's TCP connections sometimes add extra 40ms latency due to not + enabling TCP_NODELAY. HTTP and SMTP/LMTP connections weren't + affected, but everything else was. This delay wasn't always visible - + only in some situations with some message/packet sizes. + - imapc: Fix various crash conditions + - Dovecot builds were not always reproducible. + - login-proxy: With shutdown_clients=no after config reload the + existing connections could no longer be listed or kicked with doveadm. + - "doveadm proxy kick" with -f parameter caused a crash in some + situations. + - Auth policy can cause segmentation fault crash during auth process + shutdown if all auth requests have not been finished. + - Fix various minor bugs leading into incorrect behaviour in mailbox + list index handling. These rarely caused noticeable problems. + - LDAP auth: Iteration accesses freed memory, possibly crashing + auth-worker + - local_name { .. } filter in dovecot.conf does not correctly support + multiple names and wildcards were matched incorrectly. + - replicator: dsync assert-crashes if it can't connect to remote TCP + server. + - config: Memory leak in config process when ssl_dh setting wasn't + set and there was no ssl-parameters.dat file. + This caused config process to die once in a while + with "out of memory". + +------------------------------------------------------------------- +Mon May 20 14:25:49 UTC 2019 - Peter Varkoly <[email protected]> + +- bsc#1134242 - upgrade from 42.3 to 15.1: dovecot shows Unknown + protocol 'SSLv2' + * remove !SSLv2 from existing ssl_protocols configuration + during upgrade + +------------------------------------------------------------------- Old: ---- dovecot-2.3-pigeonhole-0.5.6.tar.gz dovecot-2.3-pigeonhole-0.5.6.tar.gz.sig dovecot-2.3.6.tar.gz dovecot-2.3.6.tar.gz.sig New: ---- dovecot-2.3-pigeonhole-0.5.7.1.tar.gz dovecot-2.3-pigeonhole-0.5.7.1.tar.gz.sig dovecot-2.3.7.1.tar.gz dovecot-2.3.7.1.tar.gz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ dovecot23.spec ++++++ --- /var/tmp/diff_new_pack.DtdlXQ/_old 2019-07-26 12:40:24.949906344 +0200 +++ /var/tmp/diff_new_pack.DtdlXQ/_new 2019-07-26 12:40:24.953906341 +0200 @@ -17,11 +17,11 @@ Name: dovecot23 -Version: 2.3.6 +Version: 2.3.7.1 Release: 0 %define pkg_name dovecot -%define dovecot_version 2.3.6 -%define dovecot_pigeonhole_version 0.5.6 +%define dovecot_version 2.3.7.1 +%define dovecot_pigeonhole_version 0.5.7.1 %define dovecot_branch 2.3 %define dovecot_pigeonhole_source_dir %{pkg_name}-%{dovecot_branch}-pigeonhole-%{dovecot_pigeonhole_version} %define dovecot_pigeonhole_docdir %{_docdir}/%{pkg_name}/dovecot-pigeonhole @@ -472,6 +472,10 @@ fi %endif fi +# remove !SSLv2 from ssl_protocols (no longer supported in openssl-1.1.0) +if grep -s -q "ssl_protocols .*!SSLv2" /etc/dovecot/conf.d/10-ssl.conf; then + sed -i 's/^\(ssl_protocols.*\)[[:blank:]]!SSLv2\(.*\)$/\1\2/g' /etc/dovecot/conf.d/10-ssl.conf +fi %post -p /sbin/ldconfig ++++++ dovecot-2.3-pigeonhole-0.5.6.tar.gz -> dovecot-2.3-pigeonhole-0.5.7.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/ChangeLog new/dovecot-2.3-pigeonhole-0.5.7.1/ChangeLog --- old/dovecot-2.3-pigeonhole-0.5.6/ChangeLog 2019-04-30 14:26:49.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/ChangeLog 2019-07-23 12:20:56.000000000 +0200 @@ -1,11 +1,213 @@ -2019-04-30 14:30:41 +0300 Aki Tuomi <[email protected]> (92dc263a) +2019-07-22 14:02:50 +0300 Timo Sirainen <[email protected]> (db5c74be) - Released v0.5.6 + Released v0.5.7.1 M configure.ac -2019-04-30 14:26:16 +0300 Aki Tuomi <[email protected]> (18751d35) +2019-07-22 13:58:50 +0300 Timo Sirainen <[email protected]> (fb64268c) + + NEWS: Add news for 0.5.7.1 + + +M NEWS + +2019-07-17 12:33:09 +0300 Timo Sirainen <[email protected]> (1d618448) + + doveadm-sieve: Shared attribute iteration shouldn't list Sieve scripts + + Trying to get them as shared instead of as private resulted in failure. + +M src/plugins/doveadm-sieve/doveadm-sieve-sync.c + +2019-07-12 13:23:07 +0300 Aki Tuomi <[email protected]> (5a4e63b5) + + configure: Update ABI version too + + Was forgotten from d4588dbf858b1b97662eca08bce1bd67e6ab6aa8 + +M configure.ac + +2019-07-12 13:13:21 +0300 Aki Tuomi <[email protected]> (d4588dbf) + + Released 0.5.7 + + +M configure.ac + +2019-07-12 13:12:32 +0300 Aki Tuomi <[email protected]> (9b6736a0) + + NEWS: Add news for 0.5.7 + + +M NEWS + +2019-06-18 10:59:24 +0300 Martti Rannanjärvi <[email protected]> (08e14e72) + + lib-sieve: Expand SMTP_ADDRESS_LITERAL() macro + + This makes the use of compound literal explicit. + +M src/lib-sieve/sieve-config.h +M src/lib-sieve/sieve-message.c + +2019-06-18 10:56:11 +0300 Martti Rannanjärvi <[email protected]> (1cd2a887) + + testsuite: Fix invalid compound literal use + + The lifetime of compound literals changes in gcc 9, and the old one + segfaults there. + +M src/testsuite/testsuite-message.c + +2019-06-18 10:40:52 +0300 Martti Rannanjärvi <[email protected]> (88ee6b81) + + testsuite: Expand SMTP_ADDRESS_LITERAL() macro + + This makes the use of compound literal explicit. + +M src/testsuite/testsuite-message.c + +2019-06-17 23:26:25 +0300 Martti Rannanjärvi <[email protected]> (98b44bc3) + + lib-sieve: storage: file: sieve-file-storage-save - Fix error message to + include the intended path value rather than NULL. + + +M src/lib-sieve/storage/file/sieve-file-storage-save.c + +2019-02-13 23:26:09 +0100 Stephan Bosch <[email protected]> (9e57f099) + + Adjust to changes in Dovecot SMTP submit API. + + +M src/plugins/imap-filter-sieve/imap-filter-sieve.c +M src/plugins/imapsieve/imap-sieve.c +M src/plugins/lda-sieve/lda-sieve-plugin.c + +2019-05-09 13:20:29 +0300 Timo Sirainen <[email protected]> (671cbb67) + + plugins: imap-filter-sieve: Fix accessing uninitialized variable + + It happened only when returning error, so the caller wouldn't have cared + about it anyway. This makes static analyzers happier though. + +M src/plugins/imap-filter-sieve/imap-filter-sieve.c + +2019-04-29 15:02:12 +0300 Timo Sirainen <[email protected]> (bf361227) + + plugins: imap-filter-sieve: Send FILTERED reply only if the filter did + changes + + +M src/plugins/imap-filter-sieve/imap-filter-sieve.c +M src/plugins/imap-filter-sieve/imap-filter-sieve.h +M src/plugins/imap-filter-sieve/imap-filter.c + +2019-05-02 16:01:42 +0300 Timo Sirainen <[email protected]> (501be547) + + plugins: imap-filter-sieve: Cleanup - write FILTERED reply to string first + + Simplifies the next commit. + +M src/plugins/imap-filter-sieve/imap-filter.c + +2019-04-29 15:00:39 +0300 Timo Sirainen <[email protected]> (8984e2e6) + + plugins: imap-filter-sieve: Handle each mail in a separate data stack frame + + Avoids growing memory usage excessively when filtering a lot of mails. + +M src/plugins/imap-filter-sieve/imap-filter.c + +2019-04-29 14:59:10 +0300 Timo Sirainen <[email protected]> (4c5aa3f7) + + plugins: imap-filter-sieve: Don't delete mails if script gets aborted + + +M src/plugins/imap-filter-sieve/imap-filter-sieve.c + +2019-04-29 14:57:56 +0300 Timo Sirainen <[email protected]> (c4a7978a) + + lib-sieve: Add sieve_exec_status.significant_action_executed + + +M src/lib-sieve/cmd-discard.c +M src/lib-sieve/cmd-redirect.c +M src/lib-sieve/ext-reject.c +M src/lib-sieve/plugins/duplicate/ext-duplicate-common.c +M src/lib-sieve/plugins/enotify/cmd-notify.c +M src/lib-sieve/plugins/notify/cmd-notify.c +M src/lib-sieve/plugins/vacation/cmd-vacation.c +M src/lib-sieve/plugins/vnd.dovecot/report/cmd-report.c +M src/lib-sieve/sieve-actions.c +M src/lib-sieve/sieve-types.h + +2019-04-29 14:57:25 +0300 Timo Sirainen <[email protected]> (f37b86f3) + + lib-sieve: Fix minor logic bug in handling duplicate keep actions + + This didn't seem to result in any visible bugs though. + +M src/lib-sieve/sieve-result.c + +2019-05-09 20:39:31 +0300 Timo Sirainen <[email protected]> (3fa5f564) + + lib-sieve: sieve_message_parts_add_missing() - Fix NULL checks to make + scan-build happy + + +M src/lib-sieve/sieve-message.c + +2019-05-27 09:43:25 +0300 Aki Tuomi <[email protected]> (26389171) + + doveadm-sieve: Fix script synchronization + + When dsyncing, this codepath is always called with prefix "". There is no + point checking the prefix at all. + + Broken in 479c5e57046dec76078597df844daccbfc0eb75f + +M src/plugins/doveadm-sieve/doveadm-sieve-sync.c + +2019-05-16 10:44:12 +0300 Timo Sirainen <[email protected]> (b0bf8e05) + + doc: example-config: Remove recipient_delimiter + + It defaults to the global recipient_delimiter, which should always be used + anyway. Don't add confusion by documenting the legacy setting that only + exists for backwards compatibility. + +M doc/example-config/conf.d/90-sieve.conf + +2019-05-09 13:38:15 +0300 Timo Sirainen <[email protected]> (dc2c258e) + + doc: draft-bosch-imap-filter-sieve-00.txt - update FILTERED replies and + editheader+keep + + +M doc/rfc/draft-bosch-imap-filter-sieve-00.txt + +2018-07-07 17:51:42 +0200 Stephan Bosch <[email protected]> (525b8af2) + + lib-sieve: vacation extension: Make construction of default message subject + configurable. + + +M src/lib-sieve/plugins/vacation/cmd-vacation.c +M src/lib-sieve/plugins/vacation/ext-vacation-common.c +M src/lib-sieve/plugins/vacation/ext-vacation-common.h +M tests/extensions/vacation/message.svtest + +2018-07-07 17:01:17 +0200 Stephan Bosch <[email protected]> (5bb364a1) + + lib-sieve: vacation extension: Move construction of default subject to + separate function. + + +M src/lib-sieve/plugins/vacation/cmd-vacation.c + +2019-04-30 14:26:16 +0300 Aki Tuomi <[email protected]> (5f115852) NEWS: Add news for v0.5.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/NEWS new/dovecot-2.3-pigeonhole-0.5.7.1/NEWS --- old/dovecot-2.3-pigeonhole-0.5.6/NEWS 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/NEWS 2019-07-23 12:20:46.000000000 +0200 @@ -1,3 +1,19 @@ +v0.5.7.1 2019-07-23 Timo Sirainen <[email protected]> + + - dsync: Sieve script syncing failed if mailbox attributes weren't + enabled. + +v0.5.7 2019-07-12 Aki Tuomi <[email protected]> + + + vacation: Made the subject for the automatic response message produced + by the Sieve vacation action configurable. Both the default subject + (if the script defines none) and the subject template (e.g. used to + add a subject prefix) can be configured. + - dsync: dsync-replication does not synchronize Sieve scripts. + - imap_sieve_filter: Reduce FILTER=SIEVE verbosity over IMAP connection. + - testsuite: Pigeonhole testsuite segfaulted if it was compiled with + GCC 9 + v0.5.6 2019-04-30 Aki Tuomi <[email protected]> + sieve: Redirect loop prevention is sometimes ineffective. Improve diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/configure new/dovecot-2.3-pigeonhole-0.5.7.1/configure --- old/dovecot-2.3-pigeonhole-0.5.6/configure 2019-04-30 14:26:43.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/configure 2019-07-23 12:20:51.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Pigeonhole 0.5.6. +# Generated by GNU Autoconf 2.69 for Pigeonhole 0.5.7.1. # # Report bugs to <[email protected]>. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='Pigeonhole' PACKAGE_TARNAME='dovecot-2.3-pigeonhole' -PACKAGE_VERSION='0.5.6' -PACKAGE_STRING='Pigeonhole 0.5.6' +PACKAGE_VERSION='0.5.7.1' +PACKAGE_STRING='Pigeonhole 0.5.7.1' PACKAGE_BUGREPORT='[email protected]' PACKAGE_URL='' @@ -1413,7 +1413,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Pigeonhole 0.5.6 to adapt to many kinds of systems. +\`configure' configures Pigeonhole 0.5.7.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1485,7 +1485,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Pigeonhole 0.5.6:";; + short | recursive ) echo "Configuration of Pigeonhole 0.5.7.1:";; esac cat <<\_ACEOF @@ -1610,7 +1610,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Pigeonhole configure 0.5.6 +Pigeonhole configure 0.5.7.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1979,7 +1979,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Pigeonhole $as_me 0.5.6, which was +It was created by Pigeonhole $as_me 0.5.7.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2329,7 +2329,7 @@ cat >>confdefs.h <<_ACEOF -#define PIGEONHOLE_ABI_VERSION "0.5.ABIv6($PACKAGE_VERSION)" +#define PIGEONHOLE_ABI_VERSION "0.5.ABIv7($PACKAGE_VERSION)" _ACEOF @@ -2869,7 +2869,7 @@ # Define the identity of the package. PACKAGE='dovecot-2.3-pigeonhole' - VERSION='0.5.6' + VERSION='0.5.7.1' # Some tools Automake needs. @@ -13907,7 +13907,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Pigeonhole $as_me 0.5.6, which was +This file was extended by Pigeonhole $as_me 0.5.7.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13973,7 +13973,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Pigeonhole config.status 0.5.6 +Pigeonhole config.status 0.5.7.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/configure.ac new/dovecot-2.3-pigeonhole-0.5.7.1/configure.ac --- old/dovecot-2.3-pigeonhole-0.5.6/configure.ac 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/configure.ac 2019-07-23 12:20:46.000000000 +0200 @@ -2,8 +2,8 @@ # Be sure to update ABI version also if anything changes that might require # recompiling plugins. Most importantly that means if any structs are changed. -AC_INIT([Pigeonhole], [0.5.6], [[email protected]], [dovecot-2.3-pigeonhole]) -AC_DEFINE_UNQUOTED([PIGEONHOLE_ABI_VERSION], "0.5.ABIv6($PACKAGE_VERSION)", [Pigeonhole ABI version]) +AC_INIT([Pigeonhole], [0.5.7.1], [[email protected]], [dovecot-2.3-pigeonhole]) +AC_DEFINE_UNQUOTED([PIGEONHOLE_ABI_VERSION], "0.5.ABIv7($PACKAGE_VERSION)", [Pigeonhole ABI version]) AC_CONFIG_AUX_DIR([.]) AC_CONFIG_SRCDIR([src]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/doc/example-config/conf.d/90-sieve.conf new/dovecot-2.3-pigeonhole-0.5.7.1/doc/example-config/conf.d/90-sieve.conf --- old/dovecot-2.3-pigeonhole-0.5.6/doc/example-config/conf.d/90-sieve.conf 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/doc/example-config/conf.d/90-sieve.conf 2019-07-23 12:20:46.000000000 +0200 @@ -113,15 +113,6 @@ # The sieve_extprograms plugin is included in this release. #sieve_plugins = - # The separator that is expected between the :user and :detail - # address parts introduced by the subaddress extension. This may - # also be a sequence of characters (e.g. '--'). The current - # implementation looks for the separator from the left of the - # localpart and uses the first one encountered. The :user part is - # left of the separator and the :detail part is right. This setting - # is also used by Dovecot's LMTP service. - #recipient_delimiter = + - # The maximum size of a Sieve script. The compiler will refuse to compile any # script larger than this limit. If set to 0, no limit on the script size is # enforced. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/doc/rfc/draft-bosch-imap-filter-sieve-00.txt new/dovecot-2.3-pigeonhole-0.5.7.1/doc/rfc/draft-bosch-imap-filter-sieve-00.txt --- old/dovecot-2.3-pigeonhole-0.5.6/doc/rfc/draft-bosch-imap-filter-sieve-00.txt 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/doc/rfc/draft-bosch-imap-filter-sieve-00.txt 2019-07-23 12:20:46.000000000 +0200 @@ -4,8 +4,8 @@ Network Working Group S. Bosch Internet-Draft Dovecot Oy -Intended status: Standards Track May 26, 2018 -Expires: November 27, 2018 +Intended status: Standards Track May 16, 2019 +Expires: November 17, 2019 Internet Message Access Protocol (IMAP) - FILTER=SIEVE Extension @@ -24,23 +24,23 @@ Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- - Drafts is at http://datatracker.ietf.org/drafts/current/. + Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." - This Internet-Draft will expire on November 27, 2018. + This Internet-Draft will expire on November 17, 2019. Copyright Notice - Copyright (c) 2018 IETF Trust and the persons identified as the + Copyright (c) 2019 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents - (http://trustee.ietf.org/license-info) in effect on the date of + (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must @@ -53,9 +53,9 @@ -Bosch Expires November 27, 2018 [Page 1] +Bosch Expires November 17, 2019 [Page 1] -Internet-Draft IMAP - FILTER=SIEVE Extension May 2018 +Internet-Draft IMAP - FILTER=SIEVE Extension May 2019 Table of Contents @@ -109,9 +109,9 @@ -Bosch Expires November 27, 2018 [Page 2] +Bosch Expires November 17, 2019 [Page 2] -Internet-Draft IMAP - FILTER=SIEVE Extension May 2018 +Internet-Draft IMAP - FILTER=SIEVE Extension May 2019 applying a mail filter on a set of messages that match the specified @@ -165,9 +165,9 @@ -Bosch Expires November 27, 2018 [Page 3] +Bosch Expires November 17, 2019 [Page 3] -Internet-Draft IMAP - FILTER=SIEVE Extension May 2018 +Internet-Draft IMAP - FILTER=SIEVE Extension May 2019 DELIVERY @@ -221,9 +221,9 @@ -Bosch Expires November 27, 2018 [Page 4] +Bosch Expires November 17, 2019 [Page 4] -Internet-Draft IMAP - FILTER=SIEVE Extension May 2018 +Internet-Draft IMAP - FILTER=SIEVE Extension May 2019 command returns a tagged NO response. In that case, the server @@ -240,8 +240,10 @@ Once the filter is initialized successfully, the filter is applied to each matching message. An untagged FILTERED response is sent by the - server for each of those messages. This response indicates the - result of applying the filter to the corresponding message. Refer to + server for each of the messages for which a significant action was + performed. This means any user visible action, such as a flag change + or moving the mail to another mailbox. It is also sent for messages + where the filter resulted in errors or warnings. Refer to Section 3.3 for details. The (implicit) "keep" action of the Sieve filter [SIEVE] leaves the @@ -275,11 +277,9 @@ - - -Bosch Expires November 27, 2018 [Page 5] +Bosch Expires November 17, 2019 [Page 5] -Internet-Draft IMAP - FILTER=SIEVE Extension May 2018 +Internet-Draft IMAP - FILTER=SIEVE Extension May 2019 Example: @@ -299,7 +299,7 @@ C: } C: C: - C: ALL + C: ALL S: * FILTER (TAG "A003") ERROR "line 1: unknown test command `subject'" S: A003 NO Sieve filter failed to compile @@ -313,7 +313,7 @@ C: } C: C: - C: ALL + C: ALL S: * 1 FETCH (UID 41 FLAGS (\Deleted \Seen)) S: * 1 FILTERED (TAG "A004") UID 41 OK S: * 2 FETCH (UID 45 FLAGS (\Deleted)) @@ -333,9 +333,9 @@ -Bosch Expires November 27, 2018 [Page 6] +Bosch Expires November 17, 2019 [Page 6] -Internet-Draft IMAP - FILTER=SIEVE Extension May 2018 +Internet-Draft IMAP - FILTER=SIEVE Extension May 2019 per-message filter result @@ -344,8 +344,9 @@ successful, partially successful, or unsuccessful FILTER or UID FILTER command specified in Section 3.2. It is sent for each message that matched the searching criteria of the corresponding FILTER - command and it indicates the success/failure result of applying the - filter to that message. + command and that the filter successfully changed in some way. It is + also sent for messages where the filter resulted in errors or + warnings. This success/failure result is indicated in the reply. The FILTERED response starts with a message number. Just like the untagged FETCH response, the message number is always a message @@ -388,10 +389,9 @@ - -Bosch Expires November 27, 2018 [Page 7] +Bosch Expires November 17, 2019 [Page 7] -Internet-Draft IMAP - FILTER=SIEVE Extension May 2018 +Internet-Draft IMAP - FILTER=SIEVE Extension May 2019 3.4. FILTER Untagged Response @@ -445,9 +445,9 @@ -Bosch Expires November 27, 2018 [Page 8] +Bosch Expires November 17, 2019 [Page 8] -Internet-Draft IMAP - FILTER=SIEVE Extension May 2018 +Internet-Draft IMAP - FILTER=SIEVE Extension May 2019 4. Semantics of Sieve Actions @@ -491,19 +491,19 @@ the (implicit) "keep" action means that the message is treated as it would have been if no Sieve script were run. For FILTER=SIEVE, this means that the message is left in the mailbox. If actions have been - taken that change the message, those changes are considered transient - and MUST NOT be retained for any "keep" action (because IMAP messages - are immutable). No error is generated, but the original message, - without the changes, is kept. + taken that change the message, a new modified message is appended and + the original message is marked as deleted. -Bosch Expires November 27, 2018 [Page 9] + + +Bosch Expires November 17, 2019 [Page 9] -Internet-Draft IMAP - FILTER=SIEVE Extension May 2018 +Internet-Draft IMAP - FILTER=SIEVE Extension May 2019 4.2. The "fileinto" Action @@ -557,9 +557,9 @@ -Bosch Expires November 27, 2018 [Page 10] +Bosch Expires November 17, 2019 [Page 10] -Internet-Draft IMAP - FILTER=SIEVE Extension May 2018 +Internet-Draft IMAP - FILTER=SIEVE Extension May 2019 4.5. The "notify" Action @@ -593,10 +593,10 @@ its functions can be used in scripts executed in FILTER=SIEVE context, but any changes made to the message, using the "replace" or "enclose" action, MUST be considered transient and are only - applicable with actions such as "redirect" and "fileinto". Because - messages in IMAP mailboxes are immutable, such changes are not - applicable for the "keep" action (explicit or implicit). See - Section 4.1. + applicable with actions such as "redirect" and "fileinto". If the + "keep" action (explicit or implicit) is used, the editheader results + in appending a new modified message and marking the original message + deleted. See Section 4.1. 4.9. The "imapsieve" extension @@ -613,9 +613,9 @@ -Bosch Expires November 27, 2018 [Page 11] +Bosch Expires November 17, 2019 [Page 11] -Internet-Draft IMAP - FILTER=SIEVE Extension May 2018 +Internet-Draft IMAP - FILTER=SIEVE Extension May 2019 4.10. Ignored Actions @@ -669,9 +669,9 @@ -Bosch Expires November 27, 2018 [Page 12] +Bosch Expires November 17, 2019 [Page 12] -Internet-Draft IMAP - FILTER=SIEVE Extension May 2018 +Internet-Draft IMAP - FILTER=SIEVE Extension May 2019 5.1. The "hasflag" Test @@ -725,9 +725,9 @@ -Bosch Expires November 27, 2018 [Page 13] +Bosch Expires November 17, 2019 [Page 13] -Internet-Draft IMAP - FILTER=SIEVE Extension May 2018 +Internet-Draft IMAP - FILTER=SIEVE Extension May 2019 7. Formal Syntax @@ -746,9 +746,9 @@ ; CHARSET argument MUST be registered with IANA filter-spec = "SIEVE" SP "DELIVERY" / - "SIEVE" SP "PERSONAL" sieve-name / - "SIEVE" SP "GLOBAL" sieve-name / - "SIEVE" SP "SCRIPT" sieve-literal + "SIEVE" SP "PERSONAL" SP sieve-name / + "SIEVE" SP "GLOBAL" SP sieve-name / + "SIEVE" SP "SCRIPT" SP sieve-literal filter-correlator = "(" "TAG" SP tag-string ")" @@ -781,9 +781,9 @@ -Bosch Expires November 27, 2018 [Page 14] +Bosch Expires November 17, 2019 [Page 14] -Internet-Draft IMAP - FILTER=SIEVE Extension May 2018 +Internet-Draft IMAP - FILTER=SIEVE Extension May 2019 any obvious security concerns. However, when ManageSieve is not @@ -837,9 +837,9 @@ -Bosch Expires November 27, 2018 [Page 15] +Bosch Expires November 17, 2019 [Page 15] -Internet-Draft IMAP - FILTER=SIEVE Extension May 2018 +Internet-Draft IMAP - FILTER=SIEVE Extension May 2019 [IMAPSIEVE] @@ -893,9 +893,9 @@ -Bosch Expires November 27, 2018 [Page 16] +Bosch Expires November 17, 2019 [Page 16] -Internet-Draft IMAP - FILTER=SIEVE Extension May 2018 +Internet-Draft IMAP - FILTER=SIEVE Extension May 2019 [SIEVE-INCLUDE] @@ -911,8 +911,8 @@ [SIEVE-REJECT] Stone, A., Ed., "Sieve Email Filtering: Reject and Extended Reject Extensions", RFC 5429, - DOI 10.17487/RFC5429, March 2009, <https://www.rfc- - editor.org/info/rfc5429>. + DOI 10.17487/RFC5429, March 2009, + <https://www.rfc-editor.org/info/rfc5429>. [SIEVE-SPAMVIRUSTEST] Daboo, C., "Sieve Email Filtering: Spamtest and Virustest @@ -949,4 +949,4 @@ -Bosch Expires November 27, 2018 [Page 17] +Bosch Expires November 17, 2019 [Page 17] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/pigeonhole-version.h new/dovecot-2.3-pigeonhole-0.5.7.1/pigeonhole-version.h --- old/dovecot-2.3-pigeonhole-0.5.6/pigeonhole-version.h 2019-04-30 14:26:48.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/pigeonhole-version.h 2019-07-23 12:20:56.000000000 +0200 @@ -1,6 +1,6 @@ #ifndef PIGEONHOLE_VERSION_H #define PIGEONHOLE_VERSION_H -#define PIGEONHOLE_VERSION_FULL PIGEONHOLE_VERSION" (92dc263a)" +#define PIGEONHOLE_VERSION_FULL PIGEONHOLE_VERSION" (db5c74be)" #endif /* PIGEONHOLE_VERSION_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/cmd-discard.c new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/cmd-discard.c --- old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/cmd-discard.c 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/cmd-discard.c 2019-07-23 12:20:46.000000000 +0200 @@ -154,6 +154,7 @@ const struct sieve_action_exec_env *aenv, void *tr_context ATTR_UNUSED, bool *keep) { + aenv->exec_status->significant_action_executed = TRUE; sieve_result_global_log(aenv, "marked message to be discarded if not explicitly delivered " "(discard action)"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/cmd-redirect.c new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/cmd-redirect.c --- old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/cmd-redirect.c 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/cmd-redirect.c 2019-07-23 12:20:46.000000000 +0200 @@ -576,6 +576,7 @@ sieve_action_duplicate_mark(senv, dupeid, strlen(dupeid), ioloop_time + svinst->redirect_duplicate_period); + aenv->exec_status->significant_action_executed = TRUE; sieve_result_global_log( aenv, "redirect action: forwarded to <%s>", smtp_address_encode(ctx->to_address)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/ext-reject.c new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/ext-reject.c --- old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/ext-reject.c 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/ext-reject.c 2019-07-23 12:20:46.000000000 +0200 @@ -519,6 +519,7 @@ (aenv, recipient, rj_ctx->reason)) <= 0 ) return ret; + aenv->exec_status->significant_action_executed = TRUE; sieve_result_global_log(aenv, "rejected message from <%s> (%s)", smtp_address_encode(sender), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/plugins/duplicate/ext-duplicate-common.c new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/plugins/duplicate/ext-duplicate-common.c --- old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/plugins/duplicate/ext-duplicate-common.c 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/plugins/duplicate/ext-duplicate-common.c 2019-07-23 12:20:46.000000000 +0200 @@ -118,6 +118,7 @@ /* Message was handled successfully, so track duplicate for this * message. */ + aenv->exec_status->significant_action_executed = TRUE; sieve_action_duplicate_mark (senv, data->hash, sizeof(data->hash), ioloop_time + data->period); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/plugins/enotify/cmd-notify.c new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/plugins/enotify/cmd-notify.c --- old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/plugins/enotify/cmd-notify.c 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/plugins/enotify/cmd-notify.c 2019-07-23 12:20:46.000000000 +0200 @@ -578,6 +578,8 @@ (aenv->ehandler, NULL, "notify action"); ret = method->def->action_execute(&nenv, act); + if (ret >= 0) + aenv->exec_status->significant_action_executed = TRUE; sieve_error_handler_unref(&nenv.ehandler); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/plugins/notify/cmd-notify.c new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/plugins/notify/cmd-notify.c --- old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/plugins/notify/cmd-notify.c 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/plugins/notify/cmd-notify.c 2019-07-23 12:20:46.000000000 +0200 @@ -838,7 +838,10 @@ result = act_notify_send(aenv, act); } T_END; - return ( result ? SIEVE_EXEC_OK : SIEVE_EXEC_FAILURE ); + if (!result) + return SIEVE_EXEC_FAILURE; + aenv->exec_status->significant_action_executed = TRUE; + return SIEVE_EXEC_OK; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/plugins/vacation/cmd-vacation.c new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/plugins/vacation/cmd-vacation.c --- old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/plugins/vacation/cmd-vacation.c 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/plugins/vacation/cmd-vacation.c 2019-07-23 12:20:46.000000000 +0200 @@ -10,6 +10,7 @@ #include "ostream.h" #include "message-address.h" #include "message-date.h" +#include "var-expand.h" #include "ioloop.h" #include "mail-storage.h" @@ -947,6 +948,57 @@ return SIEVE_EXEC_OK; } +static const struct var_expand_table * +_get_var_expand_table(const struct sieve_action_exec_env *aenv ATTR_UNUSED, + const char *subject) +{ + const struct var_expand_table stack_tab[] = { + { '$', subject, "subject" }, + { '\0', NULL, NULL } + }; + return p_memdup(unsafe_data_stack_pool, stack_tab, sizeof(stack_tab)); +} + +static int +act_vacation_get_default_subject(const struct sieve_action_exec_env *aenv, + const struct ext_vacation_config *config, + const char **subject_r) +{ + const struct sieve_message_data *msgdata = aenv->msgdata; + const char *header, *error; + string_t *str; + const struct var_expand_table *tab; + int ret; + + *subject_r = (config->default_subject == NULL ? + "Automated reply" : config->default_subject); + if ((ret=mail_get_first_header_utf8(msgdata->mail, "subject", + &header)) < 0 ) { + return sieve_result_mail_error( + aenv, msgdata->mail, "vacation action: " + "failed to read header field `subject'"); + } + if (ret == 0) + return SIEVE_EXEC_OK; + if (config->default_subject_template == NULL) { + *subject_r = t_strconcat("Auto: ", header, NULL); + return SIEVE_EXEC_OK; + } + + str = t_str_new(256); + tab = _get_var_expand_table(aenv, header); + if (var_expand(str, config->default_subject_template, + tab, &error) <= 0) { + i_error("Failed to expand deliver_log_format=%s: %s", + config->default_subject_template, error); + *subject_r = t_strconcat("Auto: ", header, NULL); + return SIEVE_EXEC_OK; + } + + *subject_r = str_c(str); + return SIEVE_EXEC_OK; +} + static int act_vacation_send (const struct sieve_action_exec_env *aenv, const struct ext_vacation_config *config, @@ -975,17 +1027,9 @@ /* Make sure we have a subject for our reply */ if ( ctx->subject == NULL || *(ctx->subject) == '\0' ) { - if ( (ret=mail_get_first_header_utf8 - (msgdata->mail, "subject", &header)) < 0 ) { - return sieve_result_mail_error(aenv, msgdata->mail, - "vacation action: " - "failed to read header field `subject'"); - } - if ( ret > 0 && header != NULL ) { - subject = t_strconcat("Auto: ", header, NULL); - } else { - subject = "Automated reply"; - } + if ((ret=act_vacation_get_default_subject(aenv, config, + &subject)) <= 0) + return ret; } else { subject = ctx->subject; } @@ -1090,6 +1134,7 @@ return SIEVE_EXEC_FAILURE; } + aenv->exec_status->significant_action_executed = TRUE; return SIEVE_EXEC_OK; } @@ -1415,6 +1460,7 @@ if ( ret == SIEVE_EXEC_OK ) { sieve_number_t seconds; + aenv->exec_status->significant_action_executed = TRUE; sieve_result_global_log(aenv, "sent vacation response to <%s>", smtp_address_encode(sender)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/plugins/vacation/ext-vacation-common.c new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/plugins/vacation/ext-vacation-common.c --- old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/plugins/vacation/ext-vacation-common.c 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/plugins/vacation/ext-vacation-common.c 2019-07-23 12:20:46.000000000 +0200 @@ -19,6 +19,7 @@ bool use_original_recipient, dont_check_recipient, send_from_recipient, to_header_ignore_envelope; unsigned long long max_subject_codepoints; + const char *default_subject, *default_subject_template; if ( *context != NULL ) { ext_vacation_unload(ext); @@ -52,6 +53,11 @@ "sieve_vacation_max_period"); } + default_subject = sieve_setting_get( + svinst, "sieve_vacation_default_subject"); + default_subject_template = sieve_setting_get( + svinst, "sieve_vacation_default_subject_template"); + if ( !sieve_setting_get_uint_value (svinst, "sieve_vacation_max_subject_codepoints", &max_subject_codepoints) ) { max_subject_codepoints = EXT_VACATION_DEFAULT_MAX_SUBJECT_CODEPOINTS; @@ -83,6 +89,8 @@ config->max_period = max_period; config->default_period = default_period; config->max_subject_codepoints = max_subject_codepoints; + config->default_subject = i_strdup_empty(default_subject); + config->default_subject_template = i_strdup_empty(default_subject_template); config->use_original_recipient = use_original_recipient; config->dont_check_recipient = dont_check_recipient; config->send_from_recipient = send_from_recipient; @@ -99,5 +107,7 @@ struct ext_vacation_config *config = (struct ext_vacation_config *) ext->context; + i_free(config->default_subject); + i_free(config->default_subject_template); i_free(config); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/plugins/vacation/ext-vacation-common.h new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/plugins/vacation/ext-vacation-common.h --- old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/plugins/vacation/ext-vacation-common.h 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/plugins/vacation/ext-vacation-common.h 2019-07-23 12:20:46.000000000 +0200 @@ -17,6 +17,8 @@ unsigned int max_period; unsigned int default_period; unsigned long long max_subject_codepoints; + char *default_subject; + char *default_subject_template; bool use_original_recipient; bool dont_check_recipient; bool send_from_recipient; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/plugins/vnd.dovecot/report/cmd-report.c new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/plugins/vnd.dovecot/report/cmd-report.c --- old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/plugins/vnd.dovecot/report/cmd-report.c 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/plugins/vnd.dovecot/report/cmd-report.c 2019-07-23 12:20:46.000000000 +0200 @@ -650,6 +650,7 @@ str_sanitize(error, 512)); } } else { + aenv->exec_status->significant_action_executed = TRUE; sieve_result_global_log(aenv, "sent `%s' report to <%s>", str_sanitize(act->feedback_type, 32), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/sieve-actions.c new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/sieve-actions.c --- old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/sieve-actions.c 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/sieve-actions.c 2019-07-23 12:20:46.000000000 +0200 @@ -482,6 +482,32 @@ return box_keywords; } +static bool +have_equal_keywords(struct mail *mail, struct mail_keywords *new_kw) +{ + const ARRAY_TYPE(keyword_indexes) *old_kw_arr = + mail_get_keyword_indexes(mail); + const unsigned int *old_kw; + unsigned int i, j; + + if (array_count(old_kw_arr) != new_kw->count) + return FALSE; + if (new_kw->count == 0) + return TRUE; + + old_kw = array_front(old_kw_arr); + for (i = 0; i < new_kw->count; i++) { + /* new_kw->count equals old_kw's count and it's easier to use */ + for (j = 0; j < new_kw->count; j++) { + if (old_kw[j] == new_kw->idx[i]) + break; + } + if (j == new_kw->count) + return FALSE; + } + return TRUE; +} + static int act_store_execute (const struct sieve_action *action, const struct sieve_action_exec_env *aenv, void *tr_context) @@ -538,11 +564,17 @@ (aenv, &trans->keywords, mail->box, TRUE); if ( keywords != NULL ) { - mail_update_keywords(mail, MODIFY_REPLACE, keywords); + if (!have_equal_keywords(mail, keywords)) { + aenv->exec_status->significant_action_executed = TRUE; + mail_update_keywords(mail, MODIFY_REPLACE, keywords); + } mailbox_keywords_unref(&keywords); } - mail_update_flags(mail, MODIFY_REPLACE, trans->flags); + if ((mail_get_flags(mail) & MAIL_FLAGS_NONRECENT) != trans->flags) { + aenv->exec_status->significant_action_executed = TRUE; + mail_update_flags(mail, MODIFY_REPLACE, trans->flags); + } } return SIEVE_EXEC_OK; @@ -581,7 +613,10 @@ if ( trans->flags_altered ) { keywords = act_store_keywords_create(aenv, &trans->keywords, trans->box, FALSE); - mailbox_save_set_flags(save_ctx, trans->flags, keywords); + if (trans->flags != 0 || keywords != NULL) { + aenv->exec_status->significant_action_executed = TRUE; + mailbox_save_set_flags(save_ctx, trans->flags, keywords); + } } else { mailbox_save_copy_flags(save_ctx, mail); } @@ -590,6 +625,8 @@ sieve_act_store_get_storage_error(aenv, trans); status = ( trans->error_code == MAIL_ERROR_TEMP ? SIEVE_EXEC_TEMP_FAILURE : SIEVE_EXEC_FAILURE ); + } else { + aenv->exec_status->significant_action_executed = TRUE; } /* Deallocate keywords */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/sieve-config.h new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/sieve-config.h --- old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/sieve-config.h 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/sieve-config.h 2019-07-23 12:20:46.000000000 +0200 @@ -9,8 +9,7 @@ #define SIEVE_SCRIPT_FILEEXT "sieve" #define SIEVE_BINARY_FILEEXT "svbin" -#define DEFAULT_ENVELOPE_SENDER \ - SMTP_ADDRESS_LITERAL("MAILER-DAEMON", NULL) +#define DEFAULT_ENVELOPE_SENDER "MAILER-DAEMON" #define DEFAULT_REDIRECT_DUPLICATE_PERIOD (3600 * 12) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/sieve-message.c new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/sieve-message.c --- old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/sieve-message.c 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/sieve-message.c 2019-07-23 12:20:46.000000000 +0200 @@ -347,7 +347,8 @@ i_stream_seek(input, 0); sender = sieve_message_get_sender(msgctx); - sender = (sender == NULL ? DEFAULT_ENVELOPE_SENDER : sender ); + sender = sender == NULL ? + &((struct smtp_address){DEFAULT_ENVELOPE_SENDER, NULL}) : sender; ret = raw_mailbox_alloc_stream(msgctx->raw_mail_user, input, (time_t)-1, smtp_address_encode(sender), &box); @@ -1235,6 +1236,7 @@ } hdr_field; /* Reading headers */ + i_assert( body_part != NULL ); /* Decode block */ (void)message_decoder_decode_next_block @@ -1250,7 +1252,6 @@ } /* Save bodies only if we have a wanted content-type */ - i_assert( body_part != NULL ); save_body = iter_all || _is_wanted_content_type (content_types, body_part->content_type); continue; @@ -1260,7 +1261,6 @@ * the start of the body */ if ( hdr->eoh ) { - i_assert( body_part != NULL ); body_part->have_body = TRUE; continue; } else if ( header_part != NULL ) { @@ -1347,8 +1347,6 @@ continue; } - i_assert( body_part != NULL ); - /* Parse the content type from the Content-type header */ T_BEGIN { switch ( hdr_field ) { @@ -1376,11 +1374,15 @@ } } + /* even with an empty message there was at least the "end of headers" + block, which set the body_part. */ + i_assert( body_part != NULL ); + /* Save last body part if necessary */ if ( header_part != NULL ) { sieve_message_part_save (renv, buf, header_part, FALSE); - } else if ( body_part != NULL && save_body ) { + } else if ( save_body ) { sieve_message_part_save (renv, buf, body_part, extract_text); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/sieve-result.c new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/sieve-result.c --- old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/sieve-result.c 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/sieve-result.c 2019-07-23 12:20:46.000000000 +0200 @@ -510,11 +510,10 @@ return ret; } else { /* True duplicate */ - return sieve_result_side_effects_merge - (renv, &action, raction, seffects); + return sieve_result_side_effects_merge( + renv, &action, raction, seffects); } - - } if ( act_def != NULL && raction->action.def == act_def ) { + } else if ( act_def != NULL && raction->action.def == act_def ) { instance_count++; /* Possible duplicate */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/sieve-types.h new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/sieve-types.h --- old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/sieve-types.h 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/sieve-types.h 2019-07-23 12:20:46.000000000 +0200 @@ -258,6 +258,7 @@ bool tried_default_save:1; bool keep_original:1; bool store_failed:1; + bool significant_action_executed:1; }; /* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/storage/file/sieve-file-storage-save.c new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/storage/file/sieve-file-storage-save.c --- old/dovecot-2.3-pigeonhole-0.5.6/src/lib-sieve/storage/file/sieve-file-storage-save.c 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/lib-sieve/storage/file/sieve-file-storage-save.c 2019-07-23 12:20:46.000000000 +0200 @@ -302,8 +302,6 @@ "unlink(%s) failed: %m", fsctx->tmp_path); } - fsctx->tmp_path = NULL; - errno = output_errno; if ( ENOQUOTA(errno) ) { sieve_storage_set_error(storage, @@ -313,6 +311,7 @@ sieve_storage_set_critical(storage, "save: " "write(%s) failed: %m", fsctx->tmp_path); } + fsctx->tmp_path = NULL; } } T_END; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/plugins/doveadm-sieve/doveadm-sieve-sync.c new/dovecot-2.3-pigeonhole-0.5.7.1/src/plugins/doveadm-sieve/doveadm-sieve-sync.c --- old/dovecot-2.3-pigeonhole-0.5.6/src/plugins/doveadm-sieve/doveadm-sieve-sync.c 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/plugins/doveadm-sieve/doveadm-sieve-sync.c 2019-07-23 12:20:46.000000000 +0200 @@ -607,8 +607,7 @@ siter->super = sbox->super.attribute_iter_init(box, type, prefix); if (box->storage->user->dsyncing && - type == MAIL_ATTRIBUTE_TYPE_PRIVATE && - str_begins(prefix, MAILBOX_ATTRIBUTE_PREFIX_SIEVE)) { + type == MAIL_ATTRIBUTE_TYPE_PRIVATE) { if (sieve_attribute_iter_script_init(siter) < 0) siter->failed = TRUE; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/plugins/imap-filter-sieve/imap-filter-sieve.c new/dovecot-2.3-pigeonhole-0.5.7.1/src/plugins/imap-filter-sieve/imap-filter-sieve.c --- old/dovecot-2.3-pigeonhole-0.5.6/src/plugins/imap-filter-sieve/imap-filter-sieve.c 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/plugins/imap-filter-sieve/imap-filter-sieve.c 2019-07-23 12:20:46.000000000 +0200 @@ -504,11 +504,16 @@ IMAP_FILTER_SIEVE_USER_CONTEXT_REQUIRE(user); const struct smtp_submit_settings *smtp_set = ifsuser->client->smtp_set; struct ssl_iostream_settings ssl_set; + struct smtp_submit_input submit_input; i_zero(&ssl_set); mail_user_init_ssl_client_settings(user, &ssl_set); - return (void *)smtp_submit_init_simple(smtp_set, &ssl_set, mail_from); + i_zero(&submit_input); + submit_input.ssl = &ssl_set; + + return (void *)smtp_submit_init_simple(&submit_input, smtp_set, + mail_from); } static void @@ -768,7 +773,7 @@ sieve_sys_info(svinst, "Aborted script execution sequence " "with successful implicit keep"); - return 1; + return 0; } i_assert(last_script != NULL); /* at least one script is executed */ @@ -858,7 +863,7 @@ int imap_sieve_filter_run_mail(struct imap_filter_sieve_context *sctx, struct mail *mail, string_t **errors_r, - bool *have_warnings_r) + bool *have_warnings_r, bool *have_changes_r) { struct sieve_instance *svinst = imap_filter_sieve_get_svinst(sctx); struct mail_user *user = sctx->user; @@ -873,6 +878,8 @@ *errors_r = NULL; *have_warnings_r = FALSE; + *have_changes_r = FALSE; + i_zero(&estatus); /* Prepare error handler */ user_ehandler = imap_filter_sieve_create_error_handler(sctx); @@ -914,7 +921,6 @@ scriptenv.trace_config = trace_config; scriptenv.script_context = sctx; - i_zero(&estatus); scriptenv.exec_status = &estatus; /* Execute script(s) */ @@ -928,6 +934,7 @@ sieve_trace_log_free(&trace_log); *have_warnings_r = (sieve_get_warnings(user_ehandler) > 0); + *have_changes_r = estatus.significant_action_executed; *errors_r = sctx->errors; sieve_error_handler_unref(&user_ehandler); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/plugins/imap-filter-sieve/imap-filter-sieve.h new/dovecot-2.3-pigeonhole-0.5.7.1/src/plugins/imap-filter-sieve/imap-filter-sieve.h --- old/dovecot-2.3-pigeonhole-0.5.6/src/plugins/imap-filter-sieve/imap-filter-sieve.h 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/plugins/imap-filter-sieve/imap-filter-sieve.h 2019-07-23 12:20:46.000000000 +0200 @@ -72,7 +72,7 @@ int imap_sieve_filter_run_mail(struct imap_filter_sieve_context *sctx, struct mail *mail, string_t **errors_r, - bool *have_warnings_r); + bool *have_warnings_r, bool *have_changes_r); /* * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/plugins/imap-filter-sieve/imap-filter.c new/dovecot-2.3-pigeonhole-0.5.7.1/src/plugins/imap-filter-sieve/imap-filter.c --- old/dovecot-2.3-pigeonhole-0.5.6/src/plugins/imap-filter-sieve/imap-filter.c 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/plugins/imap-filter-sieve/imap-filter.c 2019-07-23 12:20:46.000000000 +0200 @@ -37,27 +37,30 @@ struct client *client = cmd->client; string_t *errors = NULL; bool have_warnings = FALSE; + bool have_changes = FALSE; + string_t *reply = t_str_new(128); int ret; // FIXME: return fatal error status when no mail filter activity will // work (e.g. when binary is corrupt) ret = imap_sieve_filter_run_mail(ctx->sieve, mail, - &errors, &have_warnings); + &errors, &have_warnings, &have_changes); - o_stream_nsend_str(client->output, - t_strdup_printf("* %u FILTERED (TAG %s) UID %u ", - mail->seq, cmd->tag, mail->uid)); + str_printfa(reply, "* %u FILTERED (TAG %s) UID %u ", + mail->seq, cmd->tag, mail->uid); if (ret < 0 || have_warnings) { - o_stream_nsend_str(client->output, - t_strdup_printf("%s {%"PRIuSIZE_T"}\r\n", - (ret < 0 ? "ERRORS" : "WARNINGS"), - str_len(errors))); - o_stream_nsend(client->output, - str_data(errors), str_len(errors)); - o_stream_nsend_str(client->output, "\r\n"); + str_printfa(reply, "%s {%"PRIuSIZE_T"}\r\n", + (ret < 0 ? "ERRORS" : "WARNINGS"), + str_len(errors)); + str_append_str(reply, errors); + str_append(reply, "\r\n"); + } else if (have_changes || ret > 0) { + str_append(reply, "OK\r\n"); } else { - o_stream_nsend_str(client->output, "OK\r\n"); + str_truncate(reply, 0); } + if (str_len(reply) > 0) + o_stream_nsend(client->output, str_data(reply), str_len(reply)); /* Handle the result */ if (ret < 0) { @@ -87,7 +90,11 @@ while (mailbox_search_next_nonblock(ctx->search_ctx, &mail, &tryagain)) { - if (!imap_filter_mail(cmd, mail)) + bool ret; + T_BEGIN { + ret = imap_filter_mail(cmd, mail); + } T_END; + if (!ret) break; } if (tryagain) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/plugins/imapsieve/imap-sieve.c new/dovecot-2.3-pigeonhole-0.5.7.1/src/plugins/imapsieve/imap-sieve.c --- old/dovecot-2.3-pigeonhole-0.5.6/src/plugins/imapsieve/imap-sieve.c 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/plugins/imapsieve/imap-sieve.c 2019-07-23 12:20:46.000000000 +0200 @@ -166,11 +166,16 @@ struct mail_user *user = isieve->client->user; const struct smtp_submit_settings *smtp_set = isieve->client->smtp_set; struct ssl_iostream_settings ssl_set; + struct smtp_submit_input submit_input; i_zero(&ssl_set); mail_user_init_ssl_client_settings(user, &ssl_set); - return (void *)smtp_submit_init_simple(smtp_set, &ssl_set, mail_from); + i_zero(&submit_input); + submit_input.ssl = &ssl_set; + + return (void *)smtp_submit_init_simple(&submit_input, smtp_set, + mail_from); } static void imap_sieve_smtp_add_rcpt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/plugins/lda-sieve/lda-sieve-plugin.c new/dovecot-2.3-pigeonhole-0.5.7.1/src/plugins/lda-sieve/lda-sieve-plugin.c --- old/dovecot-2.3-pigeonhole-0.5.6/src/plugins/lda-sieve/lda-sieve-plugin.c 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/plugins/lda-sieve/lda-sieve-plugin.c 2019-07-23 12:20:46.000000000 +0200 @@ -79,12 +79,16 @@ (struct mail_deliver_context *) senv->script_context; struct mail_user *user = dctx->rcpt_user; struct ssl_iostream_settings ssl_set; + struct smtp_submit_input submit_input; i_zero(&ssl_set); mail_user_init_ssl_client_settings(user, &ssl_set); - return (void *)smtp_submit_init_simple(dctx->smtp_set, - &ssl_set, mail_from); + i_zero(&submit_input); + submit_input.ssl = &ssl_set; + + return (void *)smtp_submit_init_simple(&submit_input, dctx->smtp_set, + mail_from); } static void lda_sieve_smtp_add_rcpt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/src/testsuite/testsuite-message.c new/dovecot-2.3-pigeonhole-0.5.7.1/src/testsuite/testsuite-message.c --- old/dovecot-2.3-pigeonhole-0.5.6/src/testsuite/testsuite-message.c 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/src/testsuite/testsuite-message.c 2019-07-23 12:20:46.000000000 +0200 @@ -64,6 +64,15 @@ { const struct smtp_address *recipient = NULL, *sender = NULL; + static const struct smtp_address default_recipient = { + .localpart = "recipient", + .domain = "example.com", + }; + static const struct smtp_address default_sender = { + .localpart = "sender", + .domain = "example.com", + }; + i_free(env_mail_from); i_free(env_rcpt_to); i_free(env_orig_rcpt_to); @@ -81,7 +90,7 @@ if ( recipient == NULL ) recipient = testsuite_message_get_address(mail, "To"); if ( recipient == NULL ) - recipient = SMTP_ADDRESS_LITERAL("recipient", "example.com"); + recipient = &default_recipient; /* Get sender address */ sender = testsuite_message_get_address(mail, "Return-path"); @@ -90,7 +99,7 @@ if ( sender == NULL ) sender = testsuite_message_get_address(mail, "From"); if ( sender == NULL ) - sender = SMTP_ADDRESS_LITERAL("sender", "example.com"); + sender = &default_sender; env_mail_from = smtp_address_clone(default_pool, sender); env_rcpt_to = smtp_address_clone(default_pool, recipient); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dovecot-2.3-pigeonhole-0.5.6/tests/extensions/vacation/message.svtest new/dovecot-2.3-pigeonhole-0.5.7.1/tests/extensions/vacation/message.svtest --- old/dovecot-2.3-pigeonhole-0.5.6/tests/extensions/vacation/message.svtest 2019-04-30 14:26:38.000000000 +0200 +++ new/dovecot-2.3-pigeonhole-0.5.7.1/tests/extensions/vacation/message.svtest 2019-07-23 12:20:46.000000000 +0200 @@ -62,6 +62,100 @@ } /* + * Subject - configured, no subject + */ + +test_set "message" text: +From: [email protected] +To: [email protected] + +Frop +. +; + +test_config_set "sieve_vacation_default_subject" "Something colorful"; +test_config_reload :extension "vacation"; + +test_result_reset; +test "Subject - configured, no subject" { + vacation "I am not in today!"; + + if not test_result_execute { + test_fail "execution of result failed"; + } + + test_message :smtp 0; + + if not header :is "subject" "Something colorful" { + test_fail "Subject header is incorrect"; + } +} + +/* + * Subject - configured + */ + +test_set "message" text: +From: [email protected] +Subject: Bloemetjes +To: [email protected] + +Frop +. +; + +test_config_set "sieve_vacation_default_subject_template" + "Automatisch bericht: %$"; +test_config_reload :extension "vacation"; + +test_result_reset; +test "Subject - configured" { + vacation "I am not in today!"; + + if not test_result_execute { + test_fail "execution of result failed"; + } + + test_message :smtp 0; + + if not header :is "subject" "Automatisch bericht: Bloemetjes" { + test_fail "Subject header is incorrect"; + } +} + +/* + * Subject - configured, full variable + */ + +test_set "message" text: +From: [email protected] +Subject: Bloemetjes +To: [email protected] + +Frop +. +; + +test_config_set "sieve_vacation_default_subject_template" + "Automatisch bericht: %{subject}"; +test_config_reload :extension "vacation"; + +test_result_reset; +test "Subject - configured, full variable" { + vacation "I am not in today!"; + + if not test_result_execute { + test_fail "execution of result failed"; + } + + test_message :smtp 0; + + if not header :is "subject" "Automatisch bericht: Bloemetjes" { + test_fail "Subject header is incorrect"; + } +} + +/* * No subject */ @@ -108,6 +202,10 @@ . ; +test_config_set "sieve_vacation_default_subject_template" ""; +test_config_set "sieve_vacation_default_subject" ""; +test_config_reload :extension "vacation"; + test_result_reset; test "Extremely long subject" { vacation "I am not in today!"; @@ -167,6 +265,10 @@ . ; +test_config_set "sieve_vacation_default_subject_template" ""; +test_config_set "sieve_vacation_default_subject" ""; +test_config_reload :extension "vacation"; + test_result_reset; test "Extremely long japanese subject" { vacation "I am not in today!"; @@ -227,6 +329,9 @@ . ; + +test_config_set "sieve_vacation_default_subject_template" ""; +test_config_set "sieve_vacation_default_subject" ""; test_config_set "sieve_vacation_max_subject_codepoints" "20"; test_config_reload :extension "vacation"; ++++++ dovecot-2.3-pigeonhole-0.5.6.tar.gz -> dovecot-2.3.7.1.tar.gz ++++++ /work/SRC/openSUSE:Factory/dovecot23/dovecot-2.3-pigeonhole-0.5.6.tar.gz /work/SRC/openSUSE:Factory/.dovecot23.new.4126/dovecot-2.3.7.1.tar.gz differ: char 5, line 1
