summaryrefslogtreecommitdiff
path: root/sieve
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2015-10-25 23:18:36 +0200
committerSergey Poznyakoff <gray@gnu.org>2015-10-25 23:26:00 +0200
commit9a908ba5a87216d24112e36f7f9c7ffbc6dd53a3 (patch)
tree40a683bb2696653d6cd9f233369968fe03ea336c /sieve
parentdcbf8f353e76d506ecf7ae6c48081783166a82ab (diff)
downloadmailutils-9a908ba5a87216d24112e36f7f9c7ffbc6dd53a3.tar.gz
mailutils-9a908ba5a87216d24112e36f7f9c7ffbc6dd53a3.tar.bz2
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.
Diffstat (limited to 'sieve')
-rw-r--r--sieve/tests/Makefile.am1
-rw-r--r--sieve/tests/testsuite.at2
-rw-r--r--sieve/tests/vacation.at251
3 files changed, 253 insertions, 1 deletions
diff --git a/sieve/tests/Makefile.am b/sieve/tests/Makefile.am
index e16acee02..abcad970d 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 c7c7c2c74..7bfd5fc68 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 000000000..525bd1be0
--- /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-DAEMON@nonexistent.net
+ENVELOPE TO: <coyote@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: coyote@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-DAEMON@nonexistent.net
+ENVELOPE TO: <b1ff@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: b1ff@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-DAEMON@nonexistent.net
+ENVELOPE TO: <bar@dontmailme.org>
+ 0: References: <200112232808.fERKR9N16790@dontmailme.org>
+ 1: In-Reply-To: Your message of Fri, 28 Dec 2001 23:28:08 +0200
+ 2: <200112232808.fERKR9N16790@dontmailme.org>
+ 3: Subject: =?UTF-8?Q?Re:_Coffee?=
+ 4: To: bar@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-DAEMON@nonexistent.net
+ENVELOPE TO: <coyote@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: coyote@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-DAEMON@nonexistent.net
+ENVELOPE TO: <b1ff@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: b1ff@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-DAEMON@nonexistent.net
+ENVELOPE TO: <bar@dontmailme.org>
+ 0: References: <200112232808.fERKR9N16790@dontmailme.org>
+ 1: In-Reply-To: Your message of Fri, 28 Dec 2001 23:28:08 +0200
+ 2: <200112232808.fERKR9N16790@dontmailme.org>
+ 3: Subject: =?UTF-8?Q?Re:_Coffee?=
+ 4: To: bar@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-DAEMON@nonexistent.net
+ENVELOPE TO: <coyote@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: coyote@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-DAEMON@nonexistent.net
+ENVELOPE TO: <b1ff@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: b1ff@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-DAEMON@nonexistent.net
+ENVELOPE TO: <bar@dontmailme.org>
+ 0: References: <200112232808.fERKR9N16790@dontmailme.org>
+ 1: In-Reply-To: Your message of Fri, 28 Dec 2001 23:28:08 +0200
+ 2: <200112232808.fERKR9N16790@dontmailme.org>
+ 3: Subject: =?UTF-8?Q?Re:_Coffee?=
+ 4: To: bar@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-DAEMON@nonexistent.net
+ENVELOPE TO: <coyote@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: coyote@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-DAEMON@nonexistent.net
+ENVELOPE TO: <b1ff@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: b1ff@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-DAEMON@nonexistent.net
+ENVELOPE TO: <bar@dontmailme.org>
+ 0: References: <200112232808.fERKR9N16790@dontmailme.org>
+ 1: In-Reply-To: Your message of Fri, 28 Dec 2001 23:28:08 +0200
+ 2: <200112232808.fERKR9N16790@dontmailme.org>
+ 3: Subject: =?UTF-8?Q?Re:_Coffee?=
+ 4: To: bar@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])
+

Return to:

Send suggestions and report system problems to the System administrator.