summaryrefslogtreecommitdiff
path: root/sieve
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-07-17 20:59:59 +0300
committerSergey Poznyakoff <gray@gnu.org>2020-07-17 21:03:38 +0300
commitad80cc3dcb6ff6d23eb7abbc12c7a07d6aaee64d (patch)
tree4456059f10e7c8b657e342c1538834e1b4ab1082 /sieve
parenta4dd4b7b46837c28d36b89ed9d7806c73bd701d5 (diff)
downloadmailutils-ad80cc3dcb6ff6d23eb7abbc12c7a07d6aaee64d.tar.gz
mailutils-ad80cc3dcb6ff6d23eb7abbc12c7a07d6aaee64d.tar.bz2
New test tool: mockmail
* 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.
Diffstat (limited to 'sieve')
-rw-r--r--sieve/tests/moderator.at54
-rw-r--r--sieve/tests/redirect.at119
-rw-r--r--sieve/tests/reject.at309
-rw-r--r--sieve/tests/testsuite.at2
-rw-r--r--sieve/tests/vacation.at588
5 files changed, 576 insertions, 496 deletions
diff --git a/sieve/tests/moderator.at b/sieve/tests/moderator.at
index 8b0674114..1d2dfa334 100644
--- a/sieve/tests/moderator.at
+++ b/sieve/tests/moderator.at
@@ -24,18 +24,21 @@ moderator :program "discard;";
[cp ${abs_top_srcdir}/sieve/tests/moderator.mbox mailbox
chmod +w mailbox
-MTA_DIAG=`pwd`/mta.diag
-export MTA_DIAG
+MAIL_DUMP=`pwd`/mail.dump
+export MAIL_DUMP
sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./mailbox prog || exit 1
-sed 's/ENVELOPE FROM:.*/ENVELOPE FROM/' ./mta.diag
-],
-[ENVELOPE FROM
-ENVELOPE TO: <bug-foobar-request@example.org>
- 0: To: bug-foobar-request@example.org
- 1: Subject: confirm 7e02c99a82a21a2349291a4f142ee2347bb5fd0b
- 2:
-END OF MESSAGE
+cat $MAIL_DUMP
],
+[[MSGID: 0001
+SENDER: gray@nonexistent.net
+NRCPT: 1
+RCPT[0]: bug-foobar-request@example.org
+LENGTH: 94
+To: bug-foobar-request@example.org
+Subject: confirm 7e02c99a82a21a2349291a4f142ee2347bb5fd0b
+
+
+]],
[DISCARD on msg uid 0: marking as deleted
MODERATOR on msg uid 1: discarding message
])
@@ -48,19 +51,22 @@ moderator :program "discard;" :address "<sergiusz@example.org>";
[cp ${abs_top_srcdir}/sieve/tests/moderator.mbox mailbox
chmod +w mailbox
-MTA_DIAG=`pwd`/mta.diag
-export MTA_DIAG
+MAIL_DUMP=`pwd`/mail.dump
+export MAIL_DUMP
sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./mailbox prog || exit 1
-cat ./mta.diag
-],
-[ENVELOPE FROM: sergiusz@example.org
-ENVELOPE TO: <bug-foobar-request@example.org>
- 0: To: bug-foobar-request@example.org
- 1: Subject: confirm 7e02c99a82a21a2349291a4f142ee2347bb5fd0b
- 2: From: <sergiusz@example.org>
- 3:
-END OF MESSAGE
+cat $MAIL_DUMP
],
+[[MSGID: 0001
+SENDER: sergiusz@example.org
+NRCPT: 1
+RCPT[0]: bug-foobar-request@example.org
+LENGTH: 123
+To: bug-foobar-request@example.org
+Subject: confirm 7e02c99a82a21a2349291a4f142ee2347bb5fd0b
+From: <sergiusz@example.org>
+
+
+]],
[DISCARD on msg uid 0: marking as deleted
MODERATOR on msg uid 1: discarding message
])
@@ -73,10 +79,10 @@ moderator :program "keep;";
[cp ${abs_top_srcdir}/sieve/tests/moderator.mbox mailbox
chmod +w mailbox
-MTA_DIAG=`pwd`/mta.diag
-export MTA_DIAG
+MAIL_DUMP=`pwd`/mta.diag
+export MAIL_DUMP
sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./mailbox prog || exit $?
-test -f ./mta.diag && echo ./mta.diag
+test -f $MAIL_DUMP && echo $MAIL_DUMP
exit 0
],
[],
diff --git a/sieve/tests/redirect.at b/sieve/tests/redirect.at
index 52c39646b..779922e9e 100644
--- a/sieve/tests/redirect.at
+++ b/sieve/tests/redirect.at
@@ -19,9 +19,9 @@ AT_KEYWORDS([action])
AT_CHECK([
MUT_PREREQ_CAPA([ENABLE_SENDMAIL])
-MTA_DIAG=`pwd`/mta.diag
-MTA_APPEND=1
-export MTA_DIAG MTA_APPEND
+MAIL_DUMP=`pwd`/mta.diag
+MAIL_DUMP_APPEND=1
+export MAIL_DUMP MAIL_DUMP_APPEND
AT_DATA([prog],[
require "redirect";
@@ -31,60 +31,69 @@ redirect "gray@gnu.org";
MUT_MBCOPY($abs_top_srcdir/testsuite/spool/MUT_SIEVE_MAILBOX)
sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./MUT_SIEVE_MAILBOX prog || exit 1
-sed 's/ $//' ./mta.diag
+cat $MAIL_DUMP
],
[0],
-[ENVELOPE FROM: coyote@desert.example.org
-ENVELOPE TO: <gray@gnu.org>
- 0: From: coyote@desert.example.org
- 1: To: roadrunner@acme.example.com
- 2: Subject: I have a present for you
- 3: X-Caffeine: C8H10N4O2
- 4: X-Loop-Prevention: foobar@nonexistent.net
- 5:
- 6: Look, I'm sorry about the whole anvil thing, and I really
- 7: didn't mean to try and drop it on you from the top of the
- 8: cliff. I want to try to make it up to you. I've got some
- 9: great birdseed over here at my place--top of the line
- 10: stuff--and if you come by, I'll have it all wrapped up
- 11: for you. I'm really sorry for all the problems I've caused
- 12: for you over the years, but I know we can work this out.
- 13:
- 14: --
- 15: Wile E. Coyote "Super Genius" coyote@desert.example.org
-END OF MESSAGE
-ENVELOPE FROM: b1ff@de.res.example.com
-ENVELOPE TO: <gray@gnu.org>
- 0: From: youcouldberich!@reply-by-postal-mail.invalid
- 1: To: rube@landru.example.edu
- 2: Subject: $$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$
- 3: Date: TBD
- 4: X-Number: 0015
- 5: X-Loop-Prevention: foobar@nonexistent.net
- 6:
- 7: YOU MAY HAVE ALREADY WON TEN MILLION DOLLARS, BUT I DOUBT
- 8: IT! SO JUST POST THIS TO SIX HUNDRED NEWSGROUPS! IT WILL
- 9: GUARANTEE THAT YOU GET AT LEAST FIVE RESPONSES WITH MONEY!
- 10: MONEY! MONEY! COLD HARD CASH! YOU WILL RECEIVE OVER
- 11: $20,000 IN LESS THAN TWO MONTHS! AND IT'S LEGAL!!!!!!!!!
- 12: !!!!!!!!!!!!!!!!!!111111111!!!!!!!11111111111!!1 JUST
- 13: SEND $5 IN SMALL, UNMARKED BILLS TO THE ADDRESSES BELOW!
-END OF MESSAGE
-ENVELOPE FROM: bar@dontmailme.org
-ENVELOPE TO: <gray@gnu.org>
- 0: Received: (from bar@dontmailme.org)
- 1: by dontmailme.org id fERKR9N16790
- 2: for foobar@nonexistent.net; Fri, 28 Dec 2001 22:18:08 +0200
- 3: Date: Fri, 28 Dec 2001 23:28:08 +0200
- 4: From: Bar <bar@dontmailme.org>
- 5: To: Foo Bar <foobar@nonexistent.net>
- 6: Message-Id: <200112232808.fERKR9N16790@dontmailme.org>
- 7: Subject: Coffee
- 8: X-Loop-Prevention: foobar@nonexistent.net
- 9:
- 10: How about some coffee?
-END OF MESSAGE
-],
+[[MSGID: 0001
+SENDER: coyote@desert.example.org
+NRCPT: 1
+RCPT[0]: gray@gnu.org
+LENGTH: 628
+From: coyote@desert.example.org
+To: roadrunner@acme.example.com
+Subject: I have a present for you
+X-Caffeine: C8H10N4O2
+X-Loop-Prevention: foobar@nonexistent.net
+
+Look, I'm sorry about the whole anvil thing, and I really
+didn't mean to try and drop it on you from the top of the
+cliff. I want to try to make it up to you. I've got some
+great birdseed over here at my place--top of the line
+stuff--and if you come by, I'll have it all wrapped up
+for you. I'm really sorry for all the problems I've caused
+for you over the years, but I know we can work this out.
+
+--
+Wile E. Coyote "Super Genius" coyote@desert.example.org
+
+MSGID: 0001
+SENDER: b1ff@de.res.example.com
+NRCPT: 1
+RCPT[0]: gray@gnu.org
+LENGTH: 595
+From: youcouldberich!@reply-by-postal-mail.invalid
+To: rube@landru.example.edu
+Subject: $$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$
+Date: TBD
+X-Number: 0015
+X-Loop-Prevention: foobar@nonexistent.net
+
+YOU MAY HAVE ALREADY WON TEN MILLION DOLLARS, BUT I DOUBT
+IT! SO JUST POST THIS TO SIX HUNDRED NEWSGROUPS! IT WILL
+GUARANTEE THAT YOU GET AT LEAST FIVE RESPONSES WITH MONEY!
+MONEY! MONEY! COLD HARD CASH! YOU WILL RECEIVE OVER
+$20,000 IN LESS THAN TWO MONTHS! AND IT'S LEGAL!!!!!!!!!
+!!!!!!!!!!!!!!!!!!111111111!!!!!!!11111111111!!1 JUST
+SEND $5 IN SMALL, UNMARKED BILLS TO THE ADDRESSES BELOW!
+
+MSGID: 0001
+SENDER: bar@dontmailme.org
+NRCPT: 1
+RCPT[0]: gray@gnu.org
+LENGTH: 375
+Received: (from bar@dontmailme.org)
+ by dontmailme.org id fERKR9N16790
+ for foobar@nonexistent.net; Fri, 28 Dec 2001 22:18:08 +0200
+Date: Fri, 28 Dec 2001 23:28:08 +0200
+From: Bar <bar@dontmailme.org>
+To: Foo Bar <foobar@nonexistent.net>
+Message-Id: <200112232808.fERKR9N16790@dontmailme.org>
+Subject: Coffee
+X-Loop-Prevention: foobar@nonexistent.net
+
+How about some coffee?
+
+]],
[REDIRECT on msg uid 1: to gray@gnu.org
REDIRECT on msg uid 2: to gray@gnu.org
REDIRECT on msg uid 3: to gray@gnu.org
diff --git a/sieve/tests/reject.at b/sieve/tests/reject.at
index bb917dc78..5739c598d 100644
--- a/sieve/tests/reject.at
+++ b/sieve/tests/reject.at
@@ -19,9 +19,9 @@ AT_KEYWORDS([action])
AT_CHECK([
MUT_PREREQ_CAPA([ENABLE_SENDMAIL])
-MTA_DIAG=`pwd`/mta.diag
-MTA_APPEND=1
-export MTA_DIAG MTA_APPEND
+MAIL_DUMP=`pwd`/mta.diag
+MAIL_DUMP_APPEND=1
+export MAIL_DUMP MAIL_DUMP_APPEND
AT_DATA([prog],[
require "reject";
@@ -38,160 +38,171 @@ AT_DATA([filter.sed],[
# mta log contains trailing spaces
s/ $//
# MIME boundaries are unpredictable, so we replace them with a constant string.
-s/^\( *[[0-9]][[0-9]]*: Content-Type: .*boundary=\).*/\1(boundary)/
-s/^\( *[[0-9]][[0-9]]*:\) --[[0-9]].*/\1 --(boundary)/
+s/^\(Content-Type: .*boundary=\).*/\1(boundary)/
+s/^--[[0-9]].*/--(boundary)/
# Same goes for dates.
-s/^\( *[[0-9]][[0-9]]*: The original message was received at *\).*\( from .*\)/\1(date)\2/
-s/^\( *[[0-9]][[0-9]]*: Last-Attempt-Date:\).*/\1 (date)/
-s/^\( *[[0-9]][[0-9]]*: Arrival-Date:\).*/\1 (date)/
+s/^\(The original message was received at *\).*\( from .*\)/\1(date)\2/
+s/^\(Last-Attempt-Date:\).*/\1 (date)/
+s/^\(Arrival-Date:\).*/\1 (date)/
+# Remove body lengths
+/^LENGTH: /s/: [[0-9]][[0-9]]*/: X/
])
MUT_MBCOPY($abs_top_srcdir/testsuite/spool/MUT_SIEVE_MAILBOX)
sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./MUT_SIEVE_MAILBOX prog || exit 1
-sed -f filter.sed ./mta.diag
+sed -f filter.sed $MAIL_DUMP
],
[0],
-[ENVELOPE FROM: MAILER-DAEMON@nonexistent.net
-ENVELOPE TO: <coyote@desert.example.org>
- 0: To: coyote@desert.example.org
- 1: MIME-Version: 1.0
- 2: Content-Type: multipart/mixed; boundary=(boundary)
- 3:
- 4: --(boundary)
- 5: Content-Type: text/plain;charset=UTF-8
- 6: Content-Transfer-Encoding: 8bit
- 7:
- 8: The original message was received at (date) from coyote@desert.example.org.
- 9: Message was refused by recipient's mail filtering program.
- 10: Reason given was as follows:
- 11:
- 12: I don't want to read these messages.
- 13:
- 14: Regards.
- 15:
- 16: --(boundary)
- 17: Content-Type: message/delivery-status
- 18:
- 19: Reporting-UA: sieve; GNU Mailutils AT_PACKAGE_VERSION
- 20: Arrival-Date: (date)
- 21: Final-Recipient: RFC822; foobar@nonexistent.net
- 22: Action: deleted
- 23: Disposition: automatic-action/MDN-sent-automatically;deleted
- 24: Last-Attempt-Date: (date)
- 25:
- 26: --(boundary)
- 27: Content-Type: message/rfc822
- 28:
- 29: From: coyote@desert.example.org
- 30: To: roadrunner@acme.example.com
- 31: Subject: I have a present for you
- 32: X-Caffeine: C8H10N4O2
- 33:
- 34: Look, I'm sorry about the whole anvil thing, and I really
- 35: didn't mean to try and drop it on you from the top of the
- 36: cliff. I want to try to make it up to you. I've got some
- 37: great birdseed over here at my place--top of the line
- 38: stuff--and if you come by, I'll have it all wrapped up
- 39: for you. I'm really sorry for all the problems I've caused
- 40: for you over the years, but I know we can work this out.
- 41:
- 42: --
- 43: Wile E. Coyote "Super Genius" coyote@desert.example.org
- 44:
- 45: --(boundary)
-END OF MESSAGE
-ENVELOPE FROM: MAILER-DAEMON@nonexistent.net
-ENVELOPE TO: <b1ff@de.res.example.com>
- 0: To: b1ff@de.res.example.com
- 1: MIME-Version: 1.0
- 2: Content-Type: multipart/mixed; boundary=(boundary)
- 3:
- 4: --(boundary)
- 5: Content-Type: text/plain;charset=UTF-8
- 6: Content-Transfer-Encoding: 8bit
- 7:
- 8: The original message was received at (date) from b1ff@de.res.example.com.
- 9: Message was refused by recipient's mail filtering program.
- 10: Reason given was as follows:
- 11:
- 12: I don't want to read these messages.
- 13:
- 14: Regards.
- 15:
- 16: --(boundary)
- 17: Content-Type: message/delivery-status
- 18:
- 19: Reporting-UA: sieve; GNU Mailutils AT_PACKAGE_VERSION
- 20: Arrival-Date: (date)
- 21: Final-Recipient: RFC822; foobar@nonexistent.net
- 22: Action: deleted
- 23: Disposition: automatic-action/MDN-sent-automatically;deleted
- 24: Last-Attempt-Date: (date)
- 25:
- 26: --(boundary)
- 27: Content-Type: message/rfc822
- 28:
- 29: From: youcouldberich!@reply-by-postal-mail.invalid
- 30: To: rube@landru.example.edu
- 31: Subject: $$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$
- 32: Date: TBD
- 33: X-Number: 0015
- 34:
- 35: YOU MAY HAVE ALREADY WON TEN MILLION DOLLARS, BUT I DOUBT
- 36: IT! SO JUST POST THIS TO SIX HUNDRED NEWSGROUPS! IT WILL
- 37: GUARANTEE THAT YOU GET AT LEAST FIVE RESPONSES WITH MONEY!
- 38: MONEY! MONEY! COLD HARD CASH! YOU WILL RECEIVE OVER
- 39: $20,000 IN LESS THAN TWO MONTHS! AND IT'S LEGAL!!!!!!!!!
- 40: !!!!!!!!!!!!!!!!!!111111111!!!!!!!11111111111!!1 JUST
- 41: SEND $5 IN SMALL, UNMARKED BILLS TO THE ADDRESSES BELOW!
- 42:
- 43: --(boundary)
-END OF MESSAGE
-ENVELOPE FROM: MAILER-DAEMON@nonexistent.net
-ENVELOPE TO: <bar@dontmailme.org>
- 0: To: bar@dontmailme.org
- 1: MIME-Version: 1.0
- 2: Content-Type: multipart/mixed; boundary=(boundary)
- 3:
- 4: --(boundary)
- 5: Content-Type: text/plain;charset=UTF-8
- 6: Content-Transfer-Encoding: 8bit
- 7:
- 8: The original message was received at (date) from bar@dontmailme.org.
- 9: Message was refused by recipient's mail filtering program.
- 10: Reason given was as follows:
- 11:
- 12: I don't want to read these messages.
- 13:
- 14: Regards.
- 15:
- 16: --(boundary)
- 17: Content-Type: message/delivery-status
- 18:
- 19: Reporting-UA: sieve; GNU Mailutils AT_PACKAGE_VERSION
- 20: Arrival-Date: (date)
- 21: Final-Recipient: RFC822; foobar@nonexistent.net
- 22: Action: deleted
- 23: Disposition: automatic-action/MDN-sent-automatically;deleted
- 24: Last-Attempt-Date: (date)
- 25:
- 26: --(boundary)
- 27: Content-Type: message/rfc822
- 28:
- 29: Received: (from bar@dontmailme.org)
- 30: by dontmailme.org id fERKR9N16790
- 31: for foobar@nonexistent.net; Fri, 28 Dec 2001 22:18:08 +0200
- 32: Date: Fri, 28 Dec 2001 23:28:08 +0200
- 33: From: Bar <bar@dontmailme.org>
- 34: To: Foo Bar <foobar@nonexistent.net>
- 35: Message-Id: <200112232808.fERKR9N16790@dontmailme.org>
- 36: Subject: Coffee
- 37:
- 38: How about some coffee?
- 39:
- 40: --(boundary)
-END OF MESSAGE
+[MSGID: 0001
+SENDER: MAILER-DAEMON@nonexistent.net
+NRCPT: 1
+RCPT[[0]]: coyote@desert.example.org
+LENGTH: X
+To: coyote@desert.example.org
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary=(boundary)
+
+--(boundary)
+Content-Type: text/plain;charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The original message was received at (date) from coyote@desert.example.org.
+Message was refused by recipient's mail filtering program.
+Reason given was as follows:
+
+I don't want to read these messages.
+
+Regards.
+
+--(boundary)
+Content-Type: message/delivery-status
+
+Reporting-UA: sieve; GNU Mailutils AT_PACKAGE_VERSION
+Arrival-Date: (date)
+Final-Recipient: RFC822; foobar@nonexistent.net
+Action: deleted
+Disposition: automatic-action/MDN-sent-automatically;deleted
+Last-Attempt-Date: (date)
+
+--(boundary)
+Content-Type: message/rfc822
+
+From: coyote@desert.example.org
+To: roadrunner@acme.example.com
+Subject: I have a present for you
+X-Caffeine: C8H10N4O2
+
+Look, I'm sorry about the whole anvil thing, and I really
+didn't mean to try and drop it on you from the top of the
+cliff. I want to try to make it up to you. I've got some
+great birdseed over here at my place--top of the line
+stuff--and if you come by, I'll have it all wrapped up
+for you. I'm really sorry for all the problems I've caused
+for you over the years, but I know we can work this out.
+
+--
+Wile E. Coyote "Super Genius" coyote@desert.example.org
+
+--(boundary)
+
+MSGID: 0001
+SENDER: MAILER-DAEMON@nonexistent.net
+NRCPT: 1
+RCPT[[0]]: b1ff@de.res.example.com
+LENGTH: X
+To: b1ff@de.res.example.com
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary=(boundary)
+
+--(boundary)
+Content-Type: text/plain;charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The original message was received at (date) from b1ff@de.res.example.com.
+Message was refused by recipient's mail filtering program.
+Reason given was as follows:
+
+I don't want to read these messages.
+
+Regards.
+
+--(boundary)
+Content-Type: message/delivery-status
+
+Reporting-UA: sieve; GNU Mailutils AT_PACKAGE_VERSION
+Arrival-Date: (date)
+Final-Recipient: RFC822; foobar@nonexistent.net
+Action: deleted
+Disposition: automatic-action/MDN-sent-automatically;deleted
+Last-Attempt-Date: (date)
+
+--(boundary)
+Content-Type: message/rfc822
+
+From: youcouldberich!@reply-by-postal-mail.invalid
+To: rube@landru.example.edu
+Subject: $$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$
+Date: TBD
+X-Number: 0015
+
+YOU MAY HAVE ALREADY WON TEN MILLION DOLLARS, BUT I DOUBT
+IT! SO JUST POST THIS TO SIX HUNDRED NEWSGROUPS! IT WILL
+GUARANTEE THAT YOU GET AT LEAST FIVE RESPONSES WITH MONEY!
+MONEY! MONEY! COLD HARD CASH! YOU WILL RECEIVE OVER
+$20,000 IN LESS THAN TWO MONTHS! AND IT'S LEGAL!!!!!!!!!
+!!!!!!!!!!!!!!!!!!111111111!!!!!!!11111111111!!1 JUST
+SEND $5 IN SMALL, UNMARKED BILLS TO THE ADDRESSES BELOW!
+
+--(boundary)
+
+MSGID: 0001
+SENDER: MAILER-DAEMON@nonexistent.net
+NRCPT: 1
+RCPT[[0]]: bar@dontmailme.org
+LENGTH: X
+To: bar@dontmailme.org
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary=(boundary)
+
+--(boundary)
+Content-Type: text/plain;charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The original message was received at (date) from bar@dontmailme.org.
+Message was refused by recipient's mail filtering program.
+Reason given was as follows:
+
+I don't want to read these messages.
+
+Regards.
+
+--(boundary)
+Content-Type: message/delivery-status
+
+Reporting-UA: sieve; GNU Mailutils AT_PACKAGE_VERSION
+Arrival-Date: (date)
+Final-Recipient: RFC822; foobar@nonexistent.net
+Action: deleted
+Disposition: automatic-action/MDN-sent-automatically;deleted
+Last-Attempt-Date: (date)
+
+--(boundary)
+Content-Type: message/rfc822
+
+Received: (from bar@dontmailme.org)
+ by dontmailme.org id fERKR9N16790
+ for foobar@nonexistent.net; Fri, 28 Dec 2001 22:18:08 +0200
+Date: Fri, 28 Dec 2001 23:28:08 +0200
+From: Bar <bar@dontmailme.org>
+To: Foo Bar <foobar@nonexistent.net>
+Message-Id: <200112232808.fERKR9N16790@dontmailme.org>
+Subject: Coffee
+
+How about some coffee?
+
+--(boundary)
+
],
[REJECT on msg uid 1
REJECT on msg uid 2
diff --git a/sieve/tests/testsuite.at b/sieve/tests/testsuite.at
index 43c4dcef8..9752d8038 100644
--- a/sieve/tests/testsuite.at
+++ b/sieve/tests/testsuite.at
@@ -43,7 +43,7 @@ m4_define([MUT_SIEVE_CMDLINE],[dnl
MUT_SIEVE_DEFAULT_OPTIONS dnl
--line-info=no dnl
--no-program-name dnl
- -M sendmail:$abs_top_builddir/examples/mta dnl
+ -M sendmail:$abs_top_builddir/testsuite/mockmail dnl
--email foobar@nonexistent.net])
dnl ------------------------------------------------------------
diff --git a/sieve/tests/vacation.at b/sieve/tests/vacation.at
index b7a87e1d2..01dbbe330 100644
--- a/sieve/tests/vacation.at
+++ b/sieve/tests/vacation.at
@@ -23,26 +23,29 @@ MUT_SIEVE_EXT_TEST([default],[vac00],
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
+MAIL_DUMP=`pwd`/mta.diag
+MAIL_DUMP_APPEND=1
+export MAIL_DUMP MAIL_DUMP_APPEND
sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./mailbox prog || exit 1
-cat ./mta.diag
-],
-[ENVELOPE FROM: foobar@nonexistent.net
-ENVELOPE TO: <bar@dontmailme.org>
- 0: MIME-Version: 1.0
- 1: Content-Type: text/plain;charset=UTF-8
- 2: Content-Transfer-Encoding: 8bit
- 3: To: bar@dontmailme.org
- 4: Subject: =?UTF-8?Q?Re:_Coffee?=
- 5: In-Reply-To: Your message of Fri, 28 Dec 2001 23:28:08 +0200
- 6: <200112232808.fERKR9N16790@dontmailme.org>
- 7: References: <200112232808.fERKR9N16790@dontmailme.org>
- 8:
- 9: I'm on vacation
-END OF MESSAGE
+cat $MAIL_DUMP
],
+[[MSGID: 0001
+SENDER: foobar@nonexistent.net
+NRCPT: 1
+RCPT[0]: bar@dontmailme.org
+LENGTH: 321
+MIME-Version: 1.0
+Content-Type: text/plain;charset=UTF-8
+Content-Transfer-Encoding: 8bit
+To: bar@dontmailme.org
+Subject: =?UTF-8?Q?Re:_Coffee?=
+In-Reply-To: Your message of Fri, 28 Dec 2001 23:28:08 +0200
+ <200112232808.fERKR9N16790@dontmailme.org>
+References: <200112232808.fERKR9N16790@dontmailme.org>
+
+I'm on vacation
+
+]],
[VACATION on msg uid 1
VACATION on msg uid 2
VACATION on msg uid 3
@@ -54,37 +57,43 @@ MUT_SIEVE_EXT_TEST([aliases],[vac01],
vacation :database "vacation.db" :aliases [[ "roadrunner@acme.example.com" ]] "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
+MAIL_DUMP=`pwd`/mta.diag
+MAIL_DUMP_APPEND=1
+export MAIL_DUMP MAIL_DUMP_APPEND
sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./mailbox prog || exit 1
-cat ./mta.diag
-],
-[ENVELOPE FROM: roadrunner@acme.example.com
-ENVELOPE TO: <coyote@desert.example.org>
- 0: MIME-Version: 1.0
- 1: Content-Type: text/plain;charset=UTF-8
- 2: Content-Transfer-Encoding: 8bit
- 3: To: coyote@desert.example.org
- 4: Subject: =?UTF-8?Q?Re:_I_have_a_present_for_you?=
- 5: In-Reply-To: Your message of Sun May 6 22:16:47 2001
- 6:
- 7: I'm on vacation
-END OF MESSAGE
-ENVELOPE FROM: foobar@nonexistent.net
-ENVELOPE TO: <bar@dontmailme.org>
- 0: MIME-Version: 1.0
- 1: Content-Type: text/plain;charset=UTF-8
- 2: Content-Transfer-Encoding: 8bit
- 3: To: bar@dontmailme.org
- 4: Subject: =?UTF-8?Q?Re:_Coffee?=
- 5: In-Reply-To: Your message of Fri, 28 Dec 2001 23:28:08 +0200
- 6: <200112232808.fERKR9N16790@dontmailme.org>
- 7: References: <200112232808.fERKR9N16790@dontmailme.org>
- 8:
- 9: I'm on vacation
-END OF MESSAGE
+cat $MAIL_DUMP
],
+[[MSGID: 0001
+SENDER: roadrunner@acme.example.com
+NRCPT: 1
+RCPT[0]: coyote@desert.example.org
+LENGTH: 240
+MIME-Version: 1.0
+Content-Type: text/plain;charset=UTF-8
+Content-Transfer-Encoding: 8bit
+To: coyote@desert.example.org
+Subject: =?UTF-8?Q?Re:_I_have_a_present_for_you?=
+In-Reply-To: Your message of Sun May 6 22:16:47 2001
+
+I'm on vacation
+
+MSGID: 0001
+SENDER: foobar@nonexistent.net
+NRCPT: 1
+RCPT[0]: bar@dontmailme.org
+LENGTH: 321
+MIME-Version: 1.0
+Content-Type: text/plain;charset=UTF-8
+Content-Transfer-Encoding: 8bit
+To: bar@dontmailme.org
+Subject: =?UTF-8?Q?Re:_Coffee?=
+In-Reply-To: Your message of Fri, 28 Dec 2001 23:28:08 +0200
+ <200112232808.fERKR9N16790@dontmailme.org>
+References: <200112232808.fERKR9N16790@dontmailme.org>
+
+I'm on vacation
+
+]],
[VACATION on msg uid 1
VACATION on msg uid 2
VACATION on msg uid 3
@@ -96,48 +105,57 @@ MUT_SIEVE_EXT_TEST([always_reply],[vac02],
vacation :database "vacation.db" :always_reply "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
+MAIL_DUMP=`pwd`/mta.diag
+MAIL_DUMP_APPEND=1
+export MAIL_DUMP MAIL_DUMP_APPEND
sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./mailbox prog || exit 1
-cat ./mta.diag
-],
-[ENVELOPE FROM: foobar@nonexistent.net
-ENVELOPE TO: <coyote@desert.example.org>
- 0: MIME-Version: 1.0
- 1: Content-Type: text/plain;charset=UTF-8
- 2: Content-Transfer-Encoding: 8bit
- 3: To: coyote@desert.example.org
- 4: Subject: =?UTF-8?Q?Re:_I_have_a_present_for_you?=
- 5: In-Reply-To: Your message of Sun May 6 22:16:47 2001
- 6:
- 7: I'm on vacation
-END OF MESSAGE
-ENVELOPE FROM: foobar@nonexistent.net
-ENVELOPE TO: <b1ff@de.res.example.com>
- 0: MIME-Version: 1.0
- 1: Content-Type: text/plain;charset=UTF-8
- 2: Content-Transfer-Encoding: 8bit
- 3: To: b1ff@de.res.example.com
- 4: Subject: =?UTF-8?Q?Re:_$$$_YOU,_TOO,_CAN_BE_A_MILLIONAIRE!_$$$?=
- 5: In-Reply-To: Your message of TBD
- 6:
- 7: I'm on vacation
-END OF MESSAGE
-ENVELOPE FROM: foobar@nonexistent.net
-ENVELOPE TO: <bar@dontmailme.org>
- 0: MIME-Version: 1.0
- 1: Content-Type: text/plain;charset=UTF-8
- 2: Content-Transfer-Encoding: 8bit
- 3: To: bar@dontmailme.org
- 4: Subject: =?UTF-8?Q?Re:_Coffee?=
- 5: In-Reply-To: Your message of Fri, 28 Dec 2001 23:28:08 +0200
- 6: <200112232808.fERKR9N16790@dontmailme.org>
- 7: References: <200112232808.fERKR9N16790@dontmailme.org>
- 8:
- 9: I'm on vacation
-END OF MESSAGE
+cat $MAIL_DUMP
],
+[[MSGID: 0001
+SENDER: foobar@nonexistent.net
+NRCPT: 1
+RCPT[0]: coyote@desert.example.org
+LENGTH: 240
+MIME-Version: 1.0
+Content-Type: text/plain;charset=UTF-8
+Content-Transfer-Encoding: 8bit
+To: coyote@desert.example.org
+Subject: =?UTF-8?Q?Re:_I_have_a_present_for_you?=
+In-Reply-To: Your message of Sun May 6 22:16:47 2001
+
+I'm on vacation
+
+MSGID: 0001
+SENDER: foobar@nonexistent.net
+NRCPT: 1
+RCPT[0]: b1ff@de.res.example.com
+LENGTH: 232
+MIME-Version: 1.0
+Content-Type: text/plain;charset=UTF-8
+Content-Transfer-Encoding: 8bit
+To: b1ff@de.res.example.com
+Subject: =?UTF-8?Q?Re:_$$$_YOU,_TOO,_CAN_BE_A_MILLIONAIRE!_$$$?=
+In-Reply-To: Your message of TBD
+
+I'm on vacation
+
+MSGID: 0001
+SENDER: foobar@nonexistent.net
+NRCPT: 1
+RCPT[0]: bar@dontmailme.org
+LENGTH: 321
+MIME-Version: 1.0
+Content-Type: text/plain;charset=UTF-8
+Content-Transfer-Encoding: 8bit
+To: bar@dontmailme.org
+Subject: =?UTF-8?Q?Re:_Coffee?=
+In-Reply-To: Your message of Fri, 28 Dec 2001 23:28:08 +0200
+ <200112232808.fERKR9N16790@dontmailme.org>
+References: <200112232808.fERKR9N16790@dontmailme.org>
+
+I'm on vacation
+
+]],
[VACATION on msg uid 1
VACATION on msg uid 2
VACATION on msg uid 3
@@ -149,49 +167,58 @@ MUT_SIEVE_EXT_TEST([database matching],[vac03],
vacation :database "vacation.db" :always_reply "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
+MAIL_DUMP=`pwd`/mta.diag
+MAIL_DUMP_APPEND=1
+export MAIL_DUMP MAIL_DUMP_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: foobar@nonexistent.net
-ENVELOPE TO: <coyote@desert.example.org>
- 0: MIME-Version: 1.0
- 1: Content-Type: text/plain;charset=UTF-8
- 2: Content-Transfer-Encoding: 8bit
- 3: To: coyote@desert.example.org
- 4: Subject: =?UTF-8?Q?Re:_I_have_a_present_for_you?=
- 5: In-Reply-To: Your message of Sun May 6 22:16:47 2001
- 6:
- 7: I'm on vacation
-END OF MESSAGE
-ENVELOPE FROM: foobar@nonexistent.net
-ENVELOPE TO: <b1ff@de.res.example.com>
- 0: MIME-Version: 1.0
- 1: Content-Type: text/plain;charset=UTF-8
- 2: Content-Transfer-Encoding: 8bit
- 3: To: b1ff@de.res.example.com
- 4: Subject: =?UTF-8?Q?Re:_$$$_YOU,_TOO,_CAN_BE_A_MILLIONAIRE!_$$$?=
- 5: In-Reply-To: Your message of TBD
- 6:
- 7: I'm on vacation
-END OF MESSAGE
-ENVELOPE FROM: foobar@nonexistent.net
-ENVELOPE TO: <bar@dontmailme.org>
- 0: MIME-Version: 1.0
- 1: Content-Type: text/plain;charset=UTF-8
- 2: Content-Transfer-Encoding: 8bit
- 3: To: bar@dontmailme.org
- 4: Subject: =?UTF-8?Q?Re:_Coffee?=
- 5: In-Reply-To: Your message of Fri, 28 Dec 2001 23:28:08 +0200
- 6: <200112232808.fERKR9N16790@dontmailme.org>
- 7: References: <200112232808.fERKR9N16790@dontmailme.org>
- 8:
- 9: I'm on vacation
-END OF MESSAGE
+cat $MAIL_DUMP
],
+[[MSGID: 0001
+SENDER: foobar@nonexistent.net
+NRCPT: 1
+RCPT[0]: coyote@desert.example.org
+LENGTH: 240
+MIME-Version: 1.0
+Content-Type: text/plain;charset=UTF-8
+Content-Transfer-Encoding: 8bit
+To: coyote@desert.example.org
+Subject: =?UTF-8?Q?Re:_I_have_a_present_for_you?=
+In-Reply-To: Your message of Sun May 6 22:16:47 2001
+
+I'm on vacation
+
+MSGID: 0001
+SENDER: foobar@nonexistent.net
+NRCPT: 1
+RCPT[0]: b1ff@de.res.example.com
+LENGTH: 232
+MIME-Version: 1.0
+Content-Type: text/plain;charset=UTF-8
+Content-Transfer-Encoding: 8bit
+To: b1ff@de.res.example.com
+Subject: =?UTF-8?Q?Re:_$$$_YOU,_TOO,_CAN_BE_A_MILLIONAIRE!_$$$?=
+In-Reply-To: Your message of TBD
+
+I'm on vacation
+
+MSGID: 0001
+SENDER: foobar@nonexistent.net
+NRCPT: 1
+RCPT[0]: bar@dontmailme.org
+LENGTH: 321
+MIME-Version: 1.0
+Content-Type: text/plain;charset=UTF-8
+Content-Transfer-Encoding: 8bit
+To: bar@dontmailme.org
+Subject: =?UTF-8?Q?Re:_Coffee?=
+In-Reply-To: Your message of Fri, 28 Dec 2001 23:28:08 +0200
+ <200112232808.fERKR9N16790@dontmailme.org>
+References: <200112232808.fERKR9N16790@dontmailme.org>
+
+I'm on vacation
+
+]],
[VACATION on msg uid 1
VACATION on msg uid 2
VACATION on msg uid 3
@@ -206,48 +233,57 @@ MUT_SIEVE_EXT_TEST([mime],[vac04],
vacation :database "vacation.db" :always_reply :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
+MAIL_DUMP=`pwd`/mta.diag
+MAIL_DUMP_APPEND=1
+export MAIL_DUMP MAIL_DUMP_APPEND
sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./mailbox prog || exit 1
-cat ./mta.diag
-],
-[ENVELOPE FROM: foobar@nonexistent.net
-ENVELOPE TO: <coyote@desert.example.org>
- 0: MIME-Version: 1.0
- 1: Content-Type: text/plain;charset=UTF-8
- 2: Content-Transfer-Encoding: base64
- 3: To: coyote@desert.example.org
- 4: Subject: =?UTF-8?Q?Re:_I_have_a_present_for_you?=
- 5: In-Reply-To: Your message of Sun May 6 22:16:47 2001
- 6:
- 7: SSdtIG9uIHZhY2F0aW9uLg==
-END OF MESSAGE
-ENVELOPE FROM: foobar@nonexistent.net
-ENVELOPE TO: <b1ff@de.res.example.com>
- 0: MIME-Version: 1.0
- 1: Content-Type: text/plain;charset=UTF-8
- 2: Content-Transfer-Encoding: base64
- 3: To: b1ff@de.res.example.com
- 4: Subject: =?UTF-8?Q?Re:_$$$_YOU,_TOO,_CAN_BE_A_MILLIONAIRE!_$$$?=
- 5: In-Reply-To: Your message of TBD
- 6:
- 7: SSdtIG9uIHZhY2F0aW9uLg==
-END OF MESSAGE
-ENVELOPE FROM: foobar@nonexistent.net
-ENVELOPE TO: <bar@dontmailme.org>
- 0: MIME-Version: 1.0
- 1: Content-Type: text/plain;charset=UTF-8
- 2: Content-Transfer-Encoding: base64
- 3: To: bar@dontmailme.org
- 4: Subject: =?UTF-8?Q?Re:_Coffee?=
- 5: In-Reply-To: Your message of Fri, 28 Dec 2001 23:28:08 +0200
- 6: <200112232808.fERKR9N16790@dontmailme.org>
- 7: References: <200112232808.fERKR9N16790@dontmailme.org>
- 8:
- 9: SSdtIG9uIHZhY2F0aW9uLg==
-END OF MESSAGE
+cat $MAIL_DUMP
],
+[[MSGID: 0001
+SENDER: foobar@nonexistent.net
+NRCPT: 1
+RCPT[0]: coyote@desert.example.org
+LENGTH: 251
+MIME-Version: 1.0
+Content-Type: text/plain;charset=UTF-8
+Content-Transfer-Encoding: base64
+To: coyote@desert.example.org
+Subject: =?UTF-8?Q?Re:_I_have_a_present_for_you?=
+In-Reply-To: Your message of Sun May 6 22:16:47 2001
+
+SSdtIG9uIHZhY2F0aW9uLg==
+
+MSGID: 0001
+SENDER: foobar@nonexistent.net
+NRCPT: 1
+RCPT[0]: b1ff@de.res.example.com
+LENGTH: 243
+MIME-Version: 1.0
+Content-Type: text/plain;charset=UTF-8
+Content-Transfer-Encoding: base64
+To: b1ff@de.res.example.com
+Subject: =?UTF-8?Q?Re:_$$$_YOU,_TOO,_CAN_BE_A_MILLIONAIRE!_$$$?=
+In-Reply-To: Your message of TBD
+
+SSdtIG9uIHZhY2F0aW9uLg==
+
+MSGID: 0001
+SENDER: foobar@nonexistent.net
+NRCPT: 1
+RCPT[0]: bar@dontmailme.org
+LENGTH: 332
+MIME-Version: 1.0
+Content-Type: text/plain;charset=UTF-8
+Content-Transfer-Encoding: base64
+To: bar@dontmailme.org
+Subject: =?UTF-8?Q?Re:_Coffee?=
+In-Reply-To: Your message of Fri, 28 Dec 2001 23:28:08 +0200
+ <200112232808.fERKR9N16790@dontmailme.org>
+References: <200112232808.fERKR9N16790@dontmailme.org>
+
+SSdtIG9uIHZhY2F0aW9uLg==
+
+]],
[VACATION on msg uid 1
VACATION on msg uid 2
VACATION on msg uid 3
@@ -267,54 +303,63 @@ 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
+MAIL_DUMP=`pwd`/mta.diag
+MAIL_DUMP_APPEND=1
+export MAIL_DUMP MAIL_DUMP_APPEND
sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./mailbox prog || exit 1
-cat ./mta.diag
-],
-[ENVELOPE FROM: foobar@nonexistent.net
-ENVELOPE TO: <coyote@desert.example.org>
- 0: X-Mail-Processor: sieve
- 1: To: coyote@desert.example.org
- 2: Subject: =?UTF-8?Q?Re:_I_have_a_present_for_you?=
- 3: In-Reply-To: Your message of Sun May 6 22:16:47 2001
- 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: foobar@nonexistent.net
-ENVELOPE TO: <b1ff@de.res.example.com>
- 0: X-Mail-Processor: sieve
- 1: To: b1ff@de.res.example.com
- 2: Subject: =?UTF-8?Q?Re:_$$$_YOU,_TOO,_CAN_BE_A_MILLIONAIRE!_$$$?=
- 3: In-Reply-To: Your message of TBD
- 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: foobar@nonexistent.net
-ENVELOPE TO: <bar@dontmailme.org>
- 0: X-Mail-Processor: sieve
- 1: To: bar@dontmailme.org
- 2: Subject: =?UTF-8?Q?Re:_Coffee?=
- 3: In-Reply-To: Your message of Fri, 28 Dec 2001 23:28:08 +0200
- 4: <200112232808.fERKR9N16790@dontmailme.org>