This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU Mailutils".
http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=9a908ba5a87216d24112e36f7f9c7ffbc6dd53a3 The branch, master has been updated via 9a908ba5a87216d24112e36f7f9c7ffbc6dd53a3 (commit) from dcbf8f353e76d506ecf7ae6c48081783166a82ab (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9a908ba5a87216d24112e36f7f9c7ffbc6dd53a3 Author: Sergey Poznyakoff <g...@gnu.org> Date: Sun Oct 25 23:18:36 2015 +0200 Fixes in sieve vacation extension * libmu_sieve/extensions/vacation.c (build_mime): Fix memory leak. This also flushes the message body stream, so its content becomes visible for the mailer. (noreply_address_p): Rename "addresses" tag to "noreply". (check_db): The "database" tag provides vacation database name. (vacation_reply): Always set message headers. (vacation_tags): Rename "addresses" tag to "noreply". New tag: "database" * sieve/tests/vacation.at: New file. * sieve/tests/Makefile.am (TESTSUITE_AT): Add vacation.at. * sieve/tests/testsuite.at: Include vacation.at. * doc/texinfo/programs.texi: Minor change. ----------------------------------------------------------------------- Summary of changes: doc/texinfo/programs.texi | 2 +- libmu_sieve/extensions/vacation.c | 31 +++-- sieve/tests/Makefile.am | 1 + sieve/tests/testsuite.at | 2 +- sieve/tests/vacation.at | 251 +++++++++++++++++++++++++++++++++++++ 5 files changed, 274 insertions(+), 13 deletions(-) create mode 100644 sieve/tests/vacation.at diff --git a/doc/texinfo/programs.texi b/doc/texinfo/programs.texi index 54abfd9..95b9a60 100644 --- a/doc/texinfo/programs.texi +++ b/doc/texinfo/programs.texi @@ -1502,7 +1502,6 @@ requests during @var{time} seconds, the child process terminates. @node Server Statement @subsubsection Server Statement -@UNREVISED @cindex server statement @kwindex server @* Syntax: @@ -1614,6 +1613,7 @@ and is denied if any one of them denies it. auth @{ # @r{Set a list of modules for authentication.} authentication @var{module-list}; + # @r{Set a list of modules for authorization.} authorization @var{module-list}; @} diff --git a/libmu_sieve/extensions/vacation.c b/libmu_sieve/extensions/vacation.c index fee2074..067e772 100644 --- a/libmu_sieve/extensions/vacation.c +++ b/libmu_sieve/extensions/vacation.c @@ -19,10 +19,14 @@ /* Syntax: vacation [:days <ndays: number>] [:subject <subject: string>] [:aliases <address-list: list>] - [:addresses <noreply-address-list: list>] + [:noreply <noreply-address-list: list>] [:reply_regex <expr: string>] [:reply_prefix <prefix: string>] - <reply text: string> + [:sender <email: string>] + [:database <path: string>] + [:file] + [:mime] + <reply: string> */ #ifdef HAVE_CONFIG_H @@ -98,6 +102,9 @@ build_mime (mu_sieve_machine_t mach, mu_list_t tags, mu_mime_t *pmime, } rc = mu_stream_copy (stream, input, 0, NULL); + mu_stream_destroy (&input); + mu_stream_destroy (&stream); + if (rc) { mu_sieve_error (mach, @@ -105,13 +112,9 @@ build_mime (mu_sieve_machine_t mach, mu_list_t tags, mu_mime_t *pmime, mu_strerror (rc)); mu_mime_destroy (&mime); mu_message_destroy (&newmsg, NULL); - mu_stream_destroy (&input); - mu_stream_destroy (&stream); return 1; } - mu_stream_destroy (&input); - mu_header_create (&hdr, header, strlen (header)); mu_message_set_header (newmsg, hdr, NULL); @@ -157,7 +160,7 @@ _compare (void *item, void *data) /* Check whether an alias from ADDRESSES is part of To: or Cc: headers of the originating mail. Return non-zero if so and store a pointer - to the matching address to *MY_ADDRESS. */ + to the matching address in *MY_ADDRESS. */ static int match_addresses (mu_header_t hdr, mu_sieve_value_t *addresses, char **my_address) @@ -241,7 +244,7 @@ noreply_address_p (mu_sieve_machine_t mach, mu_list_t tags, char *email) for (i = 0; rc == 0 && noreply_sender[i]; i++) rc = regex_comparator (noreply_sender[i], &rd); - if (!rc && mu_sieve_tag_lookup (tags, "addresses", &arg)) + if (!rc && mu_sieve_tag_lookup (tags, "noreply", &arg)) rc = mu_sieve_vlist_do (arg, regex_comparator, &rd); return rc; @@ -338,6 +341,7 @@ check_db (mu_sieve_machine_t mach, mu_list_t tags, char *from) int rc; mu_stream_t str; mu_locker_t locker; + const char *dbfile = "~/.vacation"; if (mu_sieve_tag_lookup (tags, "days", &arg)) { @@ -348,7 +352,10 @@ check_db (mu_sieve_machine_t mach, mu_list_t tags, char *from) else days = DAYS_DEFAULT; - file = mu_tilde_expansion ("~/.vacation", MU_HIERARCHY_DELIMITER, NULL); + if (mu_sieve_tag_lookup (tags, "database", &arg)) + dbfile = arg->v.string; + + file = mu_tilde_expansion (dbfile, MU_HIERARCHY_DELIMITER, NULL); if (!file) { mu_sieve_error (mach, _("%lu: cannot build db file name"), @@ -563,9 +570,10 @@ vacation_reply (mu_sieve_machine_t mach, mu_list_t tags, mu_message_t msg, return -1; mu_mime_get_message (mime, &newmsg); mu_message_unref (newmsg); - mu_message_get_header (newmsg, &newhdr); } + mu_message_get_header (newmsg, &newhdr); + rc = mu_address_create (&to_addr, to); if (rc) { @@ -685,10 +693,11 @@ static mu_sieve_tag_def_t vacation_tags[] = { {"days", SVT_NUMBER}, {"subject", SVT_STRING}, {"aliases", SVT_STRING_LIST}, - {"addresses", SVT_STRING_LIST}, + {"noreply", SVT_STRING_LIST}, {"reply_regex", SVT_STRING}, {"reply_prefix", SVT_STRING}, {"sender", SVT_STRING}, + {"database", SVT_STRING}, {"mime", SVT_VOID}, {"file", SVT_VOID}, {NULL} diff --git a/sieve/tests/Makefile.am b/sieve/tests/Makefile.am index e16acee..abcad97 100644 --- a/sieve/tests/Makefile.am +++ b/sieve/tests/Makefile.am @@ -67,6 +67,7 @@ TESTSUITE_AT = \ size.at\ true.at\ testsuite.at\ + vacation.at\ version.at TESTSUITE = $(srcdir)/testsuite diff --git a/sieve/tests/testsuite.at b/sieve/tests/testsuite.at index c7c7c2c..7bfd5fc 100644 --- a/sieve/tests/testsuite.at +++ b/sieve/tests/testsuite.at @@ -146,5 +146,5 @@ m4_include([pipetest.at]) m4_include([list.at]) m4_include([addheader.at]) m4_include([delheader.at]) - +m4_include([vacation.at]) diff --git a/sieve/tests/vacation.at b/sieve/tests/vacation.at new file mode 100644 index 0000000..525bd1b --- /dev/null +++ b/sieve/tests/vacation.at @@ -0,0 +1,251 @@ +# This file is part of GNU Mailutils. -*- Autotest -*- +# Copyright (C) 2015 Free Software Foundation, Inc. +# +# GNU Mailutils is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 3, or (at +# your option) any later version. +# +# GNU Mailutils is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. + +AT_BANNER([vacation]) +m4_pushdef([MUT_SIEVE_EXT_NAME],[vacation]) + +MUT_SIEVE_EXT_TEST([default],[vac00], +[require "vacation"; + +vacation :database "vacation.db" "I'm on vacation"; +], +[MUT_MBCOPY($abs_top_srcdir/testsuite/spool/sieve.mbox,mailbox) +MTA_DIAG=`pwd`/mta.diag +MTA_APPEND=1 +export MTA_DIAG MTA_APPEND +sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./mailbox prog || exit 1 +cat ./mta.diag +], +[ENVELOPE FROM: mailer-dae...@nonexistent.net +ENVELOPE TO: <coy...@desert.example.org> + 0: In-Reply-To: Your message of Sun May 6 22:16:47 2001 + 1: Subject: =?UTF-8?Q?Re:_I_have_a_present_for_you?= + 2: To: coy...@desert.example.org + 3: Content-Transfer-Encoding: 8bit + 4: Content-Type: text/plain;charset=UTF-8 + 5: MIME-Version: 1.0 + 6: + 7: I'm on vacation +END OF MESSAGE +ENVELOPE FROM: mailer-dae...@nonexistent.net +ENVELOPE TO: <b...@de.res.example.com> + 0: In-Reply-To: Your message of TBD + 1: Subject: =?UTF-8?Q?Re:_$$$_YOU,_TOO,_CAN_BE_A_MILLIONAIRE!_$$$?= + 2: To: b...@de.res.example.com + 3: Content-Transfer-Encoding: 8bit + 4: Content-Type: text/plain;charset=UTF-8 + 5: MIME-Version: 1.0 + 6: + 7: I'm on vacation +END OF MESSAGE +ENVELOPE FROM: mailer-dae...@nonexistent.net +ENVELOPE TO: <b...@dontmailme.org> + 0: References: <200112232808.ferkr9n16...@dontmailme.org> + 1: In-Reply-To: Your message of Fri, 28 Dec 2001 23:28:08 +0200 + 2: <200112232808.ferkr9n16...@dontmailme.org> + 3: Subject: =?UTF-8?Q?Re:_Coffee?= + 4: To: b...@dontmailme.org + 5: Content-Transfer-Encoding: 8bit + 6: Content-Type: text/plain;charset=UTF-8 + 7: MIME-Version: 1.0 + 8: + 9: I'm on vacation +END OF MESSAGE +], +[VACATION on msg uid 1 +VACATION on msg uid 2 +VACATION on msg uid 3 +]) + +MUT_SIEVE_EXT_TEST([database matching],[vac01], +[require "vacation"; + +vacation :database "vacation.db" "I'm on vacation"; +], +[MUT_MBCOPY($abs_top_srcdir/testsuite/spool/sieve.mbox,mailbox) +MTA_DIAG=`pwd`/mta.diag +MTA_APPEND=1 +export MTA_DIAG MTA_APPEND +sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./mailbox prog || exit 1 +sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./mailbox prog || exit 1 +cat ./mta.diag +], +[ENVELOPE FROM: mailer-dae...@nonexistent.net +ENVELOPE TO: <coy...@desert.example.org> + 0: In-Reply-To: Your message of Sun May 6 22:16:47 2001 + 1: Subject: =?UTF-8?Q?Re:_I_have_a_present_for_you?= + 2: To: coy...@desert.example.org + 3: Content-Transfer-Encoding: 8bit + 4: Content-Type: text/plain;charset=UTF-8 + 5: MIME-Version: 1.0 + 6: + 7: I'm on vacation +END OF MESSAGE +ENVELOPE FROM: mailer-dae...@nonexistent.net +ENVELOPE TO: <b...@de.res.example.com> + 0: In-Reply-To: Your message of TBD + 1: Subject: =?UTF-8?Q?Re:_$$$_YOU,_TOO,_CAN_BE_A_MILLIONAIRE!_$$$?= + 2: To: b...@de.res.example.com + 3: Content-Transfer-Encoding: 8bit + 4: Content-Type: text/plain;charset=UTF-8 + 5: MIME-Version: 1.0 + 6: + 7: I'm on vacation +END OF MESSAGE +ENVELOPE FROM: mailer-dae...@nonexistent.net +ENVELOPE TO: <b...@dontmailme.org> + 0: References: <200112232808.ferkr9n16...@dontmailme.org> + 1: In-Reply-To: Your message of Fri, 28 Dec 2001 23:28:08 +0200 + 2: <200112232808.ferkr9n16...@dontmailme.org> + 3: Subject: =?UTF-8?Q?Re:_Coffee?= + 4: To: b...@dontmailme.org + 5: Content-Transfer-Encoding: 8bit + 6: Content-Type: text/plain;charset=UTF-8 + 7: MIME-Version: 1.0 + 8: + 9: I'm on vacation +END OF MESSAGE +], +[VACATION on msg uid 1 +VACATION on msg uid 2 +VACATION on msg uid 3 +VACATION on msg uid 1 +VACATION on msg uid 2 +VACATION on msg uid 3 +]) + +MUT_SIEVE_EXT_TEST([mime],[vac02], +[require "vacation"; + +vacation :database "vacation.db" :mime "I'm on vacation."; +], +[MUT_MBCOPY($abs_top_srcdir/testsuite/spool/sieve.mbox,mailbox) +MTA_DIAG=`pwd`/mta.diag +MTA_APPEND=1 +export MTA_DIAG MTA_APPEND +sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./mailbox prog || exit 1 +cat ./mta.diag +], +[ENVELOPE FROM: mailer-dae...@nonexistent.net +ENVELOPE TO: <coy...@desert.example.org> + 0: In-Reply-To: Your message of Sun May 6 22:16:47 2001 + 1: Subject: =?UTF-8?Q?Re:_I_have_a_present_for_you?= + 2: To: coy...@desert.example.org + 3: Content-Transfer-Encoding: base64 + 4: Content-Type: text/plain;charset=UTF-8 + 5: MIME-Version: 1.0 + 6: + 7: SSdtIG9uIHZhY2F0aW9uLg== +END OF MESSAGE +ENVELOPE FROM: mailer-dae...@nonexistent.net +ENVELOPE TO: <b...@de.res.example.com> + 0: In-Reply-To: Your message of TBD + 1: Subject: =?UTF-8?Q?Re:_$$$_YOU,_TOO,_CAN_BE_A_MILLIONAIRE!_$$$?= + 2: To: b...@de.res.example.com + 3: Content-Transfer-Encoding: base64 + 4: Content-Type: text/plain;charset=UTF-8 + 5: MIME-Version: 1.0 + 6: + 7: SSdtIG9uIHZhY2F0aW9uLg== +END OF MESSAGE +ENVELOPE FROM: mailer-dae...@nonexistent.net +ENVELOPE TO: <b...@dontmailme.org> + 0: References: <200112232808.ferkr9n16...@dontmailme.org> + 1: In-Reply-To: Your message of Fri, 28 Dec 2001 23:28:08 +0200 + 2: <200112232808.ferkr9n16...@dontmailme.org> + 3: Subject: =?UTF-8?Q?Re:_Coffee?= + 4: To: b...@dontmailme.org + 5: Content-Transfer-Encoding: base64 + 6: Content-Type: text/plain;charset=UTF-8 + 7: MIME-Version: 1.0 + 8: + 9: SSdtIG9uIHZhY2F0aW9uLg== +END OF MESSAGE +], +[VACATION on msg uid 1 +VACATION on msg uid 2 +VACATION on msg uid 3 +]) + +MUT_SIEVE_EXT_TEST([reply from file],[vac03], +[require "vacation"; + +vacation :database "vacation.db" :file "reply"; +], +[AT_DATA([reply],[X-Mail-Processor: sieve + +I'm on vacation right now. +I will attend to your message as soon as I'm back. + +Best regards, +Ty Coon +]) +MUT_MBCOPY($abs_top_srcdir/testsuite/spool/sieve.mbox,mailbox) +MTA_DIAG=`pwd`/mta.diag +MTA_APPEND=1 +export MTA_DIAG MTA_APPEND +sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./mailbox prog || exit 1 +cat ./mta.diag +], +[ENVELOPE FROM: mailer-dae...@nonexistent.net +ENVELOPE TO: <coy...@desert.example.org> + 0: In-Reply-To: Your message of Sun May 6 22:16:47 2001 + 1: Subject: =?UTF-8?Q?Re:_I_have_a_present_for_you?= + 2: To: coy...@desert.example.org + 3: X-Mail-Processor: sieve + 4: + 5: I'm on vacation right now. + 6: I will attend to your message as soon as I'm back. + 7: + 8: Best regards, + 9: Ty Coon +END OF MESSAGE +ENVELOPE FROM: mailer-dae...@nonexistent.net +ENVELOPE TO: <b...@de.res.example.com> + 0: In-Reply-To: Your message of TBD + 1: Subject: =?UTF-8?Q?Re:_$$$_YOU,_TOO,_CAN_BE_A_MILLIONAIRE!_$$$?= + 2: To: b...@de.res.example.com + 3: X-Mail-Processor: sieve + 4: + 5: I'm on vacation right now. + 6: I will attend to your message as soon as I'm back. + 7: + 8: Best regards, + 9: Ty Coon +END OF MESSAGE +ENVELOPE FROM: mailer-dae...@nonexistent.net +ENVELOPE TO: <b...@dontmailme.org> + 0: References: <200112232808.ferkr9n16...@dontmailme.org> + 1: In-Reply-To: Your message of Fri, 28 Dec 2001 23:28:08 +0200 + 2: <200112232808.ferkr9n16...@dontmailme.org> + 3: Subject: =?UTF-8?Q?Re:_Coffee?= + 4: To: b...@dontmailme.org + 5: X-Mail-Processor: sieve + 6: + 7: I'm on vacation right now. + 8: I will attend to your message as soon as I'm back. + 9: + 10: Best regards, + 11: Ty Coon +END OF MESSAGE +], +[VACATION on msg uid 1 +VACATION on msg uid 2 +VACATION on msg uid 3 +]) + +m4_popdef([MUT_SIEVE_EXT_NAME]) + hooks/post-receive -- GNU Mailutils _______________________________________________ Commit-mailutils mailing list Commit-mailutils@gnu.org https://lists.gnu.org/mailman/listinfo/commit-mailutils