summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2021-06-09 18:18:59 +0300
committerSergey Poznyakoff <gray@gnu.org>2021-06-09 18:18:59 +0300
commite64463fca2a11cff98d497b60f959914c3010e92 (patch)
tree48e856ac4061fb15594ef3b316a5ab64af074beb
parentb8faf6b5e5afb0303c9f4765ea919d89643706ce (diff)
downloadmailutils-e64463fca2a11cff98d497b60f959914c3010e92.tar.gz
mailutils-e64463fca2a11cff98d497b60f959914c3010e92.tar.bz2
Add tests for mail send/reply/followup commands
* mail/mail.c (main): Fix exit status in send mode. * mail/tests/Makefile.am: Add new tests. * mail/tests/testsuite.at: Likewise. * mail/tests/atlocal.in (MAILER): New variable. * mail/tests/Followup.at: New file. * mail/tests/Reply.at: New file. * mail/tests/followup.at: New file. * mail/tests/reply.at: New file. * mail/tests/send.at: New file. * mail/tests/sendbyname.at: New file. * mail/tests/sendrec.at: New file.
-rw-r--r--mail/mail.c8
-rw-r--r--mail/tests/Followup.at197
-rw-r--r--mail/tests/Makefile.am9
-rw-r--r--mail/tests/Reply.at158
-rw-r--r--mail/tests/atlocal.in1
-rw-r--r--mail/tests/followup.at148
-rw-r--r--mail/tests/reply.at109
-rw-r--r--mail/tests/send.at45
-rw-r--r--mail/tests/sendbyname.at119
-rw-r--r--mail/tests/sendrec.at64
-rw-r--r--mail/tests/testsuite.at10
11 files changed, 862 insertions, 6 deletions
diff --git a/mail/mail.c b/mail/mail.c
index 538fd709a..5e55e22fb 100644
--- a/mail/mail.c
+++ b/mail/mail.c
@@ -591,11 +591,9 @@ main (int argc, char **argv)
argv[0] = "Mail";
else
argv[0] = "mail";
- if (mail_send (argc, argv))
- rc = EXIT_FAILURE;
- if (mailvar_is_true (mailvar_name_mailx))
- rc = 0;
- return rc;
+ return mail_send (argc, argv)
+ ? (mailvar_is_true (mailvar_name_mailx) ? 0 : EXIT_FAILURE)
+ : 0;
}
/* Or acting as a normal reader */
else
diff --git a/mail/tests/Followup.at b/mail/tests/Followup.at
new file mode 100644
index 000000000..b93d36800
--- /dev/null
+++ b/mail/tests/Followup.at
@@ -0,0 +1,197 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2015-2021 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_SETUP([Followup])
+AT_KEYWORDS([reply])
+
+AT_DATA([inbox],
+[From hare@wonder.land Mon Jul 29 22:00:08 2002
+Received: (from hare@wonder.land)
+ by wonder.land id 3301
+ for alice@wonder.land; Mon, 29 Jul 2002 22:00:06 +0100
+Date: Mon, 29 Jul 2002 22:00:01 +0100
+From: March Hare <hare@wonder.land>
+Message-Id: <200207292200.3301@wonder.land>
+To: Alice <alice@wonder.land>
+Subject: Invitation
+
+Have some wine
+
+From alice@wonder.land Mon Jul 29 22:00:09 2002
+Received: (from alice@wonder.land)
+ by wonder.land id 3302
+ for hare@wonder.land; Mon, 29 Jul 2002 22:00:07 +0100
+Date: Mon, 29 Jul 2002 22:00:02 +0100
+From: Alice <alice@wonder.land>
+Message-Id: <200207292200.3302@wonder.land>
+To: March Hare <hare@wonder.land>
+Subject: Re: Invitation
+
+I don't see any wine
+
+From hatter@example.org Mon Jul 29 22:00:10 2002
+Received: (from hatter@example.org)
+ by wonder.land id 3303
+ for alice@wonder.land; Mon, 29 Jul 2002 22:00:08 +0100
+Date: Mon, 29 Jul 2002 22:00:03 +0100
+From: Hatter <hatter@example.org>
+Message-Id: <200207292200.3303@wonder.land>
+To: Alice <alice@wonder.land>
+Subject: Re: Invitation
+
+There isn't any
+
+From alice@wonder.land Mon Jul 29 22:00:11 2002
+Received: (from alice@wonder.land)
+ by wonder.land id 3304
+ for hare@wonder.land; Mon, 29 Jul 2002 22:00:09 +0100
+Date: Mon, 29 Jul 2002 22:00:04 +0100
+From: Alice <alice@wonder.land>
+Message-Id: <200207292200.3304@wonder.land>
+To: March Hare <hare@wonder.land>
+Subject: Re: Invitation
+
+Then it wasn't very civil of you to offer it
+
+From hare@wonder.land Mon Jul 29 22:00:12 2002
+Received: (from hare@wonder.land)
+ by wonder.land id 3305
+ for alice@wonder.land; Mon, 29 Jul 2002 22:00:10 +0100
+Date: Mon, 29 Jul 2002 22:00:05 +0100
+From: March Hare <hare@wonder.land>
+Message-Id: <200207292200.3305@wonder.land>
+To: Alice <alice@wonder.land>
+Subject: Re: Invitation
+
+It wasn't very civil of you to sit down without being invited
+])
+
+AT_CHECK([touch record
+mkdir folder outfolder
+])
+
+AT_DATA([com],
+[set dot indentprefix=">"
+retain To
+Followup 2 1 3
+~m
+.
+x
+])
+
+AT_CHECK([
+unset MAIL_DUMP
+MUT_MAIL_CMD -f ./inbox \
+ -E "set noheader" \
+ -E "set sendmail=$MAILER" \
+ -E "set record=$(pwd)/record" \
+ -E "set folder=$(pwd)/folder" \
+ -E "set outfolder" < com
+],
+[0],
+[To: "Alice" <alice@wonder.land>,"March Hare" <hare@wonder.land>,"Hatter" <hatter@example.org>
+Subject: Re: Invitation
+
+Interpolating: 2
+(continue)
+])
+
+AT_CHECK([
+sed -e '/^SENDER:/d' \
+ -e '/^Date:/d' \
+ -e '/^X-Mailer:/d' \
+ mail.dump],
+[0],
+[MSGID: 0001
+NRCPT: 3
+RCPT[[0]]: <alice@wonder.land>
+RCPT[[1]]: <hare@wonder.land>
+RCPT[[2]]: <hatter@example.org>
+LENGTH: 396
+To: "Alice" <alice@wonder.land>,"March Hare" <hare@wonder.land>,"Hatter" <hatter@example.org>
+Subject: Re: Invitation
+In-Reply-To: Your message of Mon, 29 Jul 2002 22:00:02 +0100
+ <200207292200.3302@wonder.land>
+References: <200207292200.3302@wonder.land>
+
+>To: March Hare <hare@wonder.land>
+>
+>I don't see any wine
+>
+
+])
+
+AT_CHECK([sed -e '1s/^From .*/Envelope/' \
+ -e '/^X-[[a-zA-Z]]*:/d' \
+ -e '/^Date:/d' folder/alice
+],
+[0],
+[Envelope
+To: "Alice" <alice@wonder.land>,"March Hare" <hare@wonder.land>,"Hatter" <hatter@example.org>
+Subject: Re: Invitation
+In-Reply-To: Your message of Mon, 29 Jul 2002 22:00:02 +0100
+ <200207292200.3302@wonder.land>
+References: <200207292200.3302@wonder.land>
+
+>To: March Hare <hare@wonder.land>
+>
+>I don't see any wine
+>
+
+])
+
+#
+#
+#
+AT_CHECK([
+unset MAIL_DUMP
+MUT_MAIL_CMD -f ./inbox \
+ -E "set noheader" \
+ -E "set sendmail=$MAILER" \
+ -E "set record=$(pwd)/record" \
+ -E "set folder=$(pwd)/folder" \
+ -E "set outfolder=$(pwd)/outfolder" < com
+],
+[0],
+[To: "Alice" <alice@wonder.land>,"March Hare" <hare@wonder.land>,"Hatter" <hatter@example.org>
+Subject: Re: Invitation
+
+Interpolating: 2
+(continue)
+])
+
+AT_CHECK([sed -e '1s/^From .*/Envelope/' \
+ -e '/^X-[[a-zA-Z]]*:/d' \
+ -e '/^Date:/d' outfolder/alice
+],
+[0],
+[Envelope
+To: "Alice" <alice@wonder.land>,"March Hare" <hare@wonder.land>,"Hatter" <hatter@example.org>
+Subject: Re: Invitation
+In-Reply-To: Your message of Mon, 29 Jul 2002 22:00:02 +0100
+ <200207292200.3302@wonder.land>
+References: <200207292200.3302@wonder.land>
+
+>To: March Hare <hare@wonder.land>
+>
+>I don't see any wine
+>
+
+])
+
+
+AT_CLEANUP
+
diff --git a/mail/tests/Makefile.am b/mail/tests/Makefile.am
index f04b30408..dafbef646 100644
--- a/mail/tests/Makefile.am
+++ b/mail/tests/Makefile.am
@@ -26,8 +26,15 @@ TESTSUITE_AT +=\
copy02.at\
copy03.at\
copy04.at\
- nohome.at\
+ followup.at\
+ Followup.at\
hold.at\
+ nohome.at\
+ reply.at\
+ Reply.at\
+ send.at\
+ sendrec.at\
+ sendbyname.at\
testsuite.at\
version.at
diff --git a/mail/tests/Reply.at b/mail/tests/Reply.at
new file mode 100644
index 000000000..08639c1bc
--- /dev/null
+++ b/mail/tests/Reply.at
@@ -0,0 +1,158 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2015-2021 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_SETUP([Reply])
+AT_KEYWORDS([reply])
+
+AT_DATA([inbox],
+[From hare@wonder.land Mon Jul 29 22:00:08 2002
+Received: (from hare@wonder.land)
+ by wonder.land id 3301
+ for alice@wonder.land; Mon, 29 Jul 2002 22:00:06 +0100
+Date: Mon, 29 Jul 2002 22:00:01 +0100
+From: March Hare <hare@wonder.land>
+Message-Id: <200207292200.3301@wonder.land>
+To: Alice <alice@wonder.land>
+Subject: Invitation
+
+Have some wine
+
+From alice@wonder.land Mon Jul 29 22:00:09 2002
+Received: (from alice@wonder.land)
+ by wonder.land id 3302
+ for hare@wonder.land; Mon, 29 Jul 2002 22:00:07 +0100
+Date: Mon, 29 Jul 2002 22:00:02 +0100
+From: Alice <alice@wonder.land>
+Message-Id: <200207292200.3302@wonder.land>
+To: March Hare <hare@wonder.land>
+Subject: Re: Invitation
+
+I don't see any wine
+
+From hatter@example.org Mon Jul 29 22:00:10 2002
+Received: (from hatter@example.org)
+ by wonder.land id 3303
+ for alice@wonder.land; Mon, 29 Jul 2002 22:00:08 +0100
+Date: Mon, 29 Jul 2002 22:00:03 +0100
+From: Hatter <hatter@example.org>
+Message-Id: <200207292200.3303@wonder.land>
+To: Alice <alice@wonder.land>
+Subject: Re: Invitation
+
+There isn't any
+
+From alice@wonder.land Mon Jul 29 22:00:11 2002
+Received: (from alice@wonder.land)
+ by wonder.land id 3304
+ for hare@wonder.land; Mon, 29 Jul 2002 22:00:09 +0100
+Date: Mon, 29 Jul 2002 22:00:04 +0100
+From: Alice <alice@wonder.land>
+Message-Id: <200207292200.3304@wonder.land>
+To: March Hare <hare@wonder.land>
+Subject: Re: Invitation
+
+Then it wasn't very civil of you to offer it
+
+From hare@wonder.land Mon Jul 29 22:00:12 2002
+Received: (from hare@wonder.land)
+ by wonder.land id 3305
+ for alice@wonder.land; Mon, 29 Jul 2002 22:00:10 +0100
+Date: Mon, 29 Jul 2002 22:00:05 +0100
+From: March Hare <hare@wonder.land>
+Message-Id: <200207292200.3305@wonder.land>
+To: Alice <alice@wonder.land>
+Subject: Re: Invitation
+
+It wasn't very civil of you to sit down without being invited
+])
+
+AT_CHECK([touch record
+mkdir folder outfolder
+])
+
+AT_CHECK([
+AT_DATA([com],
+[set dot indentprefix=">"
+retain To
+Reply 2 1 3
+~m
+.
+x
+])
+
+unset MAIL_DUMP
+MUT_MAIL_CMD -f ./inbox \
+ -E "set noheader" \
+ -E "set sendmail=$MAILER" \
+ -E "set record=$(pwd)/record" \
+ -E "set folder=$(pwd)/folder" \
+ -E "set outfolder" < com
+],
+[0],
+[To: "Alice" <alice@wonder.land>,"March Hare" <hare@wonder.land>,"Hatter" <hatter@example.org>
+Subject: Re: Invitation
+
+Interpolating: 2
+(continue)
+])
+
+AT_CHECK([
+sed -e '/^SENDER:/d' \
+ -e '/^Date:/d' \
+ -e '/^X-Mailer:/d' \
+ mail.dump],
+[0],
+[MSGID: 0001
+NRCPT: 3
+RCPT[[0]]: <alice@wonder.land>
+RCPT[[1]]: <hare@wonder.land>
+RCPT[[2]]: <hatter@example.org>
+LENGTH: 396
+To: "Alice" <alice@wonder.land>,"March Hare" <hare@wonder.land>,"Hatter" <hatter@example.org>
+Subject: Re: Invitation
+In-Reply-To: Your message of Mon, 29 Jul 2002 22:00:02 +0100
+ <200207292200.3302@wonder.land>
+References: <200207292200.3302@wonder.land>
+
+>To: March Hare <hare@wonder.land>
+>
+>I don't see any wine
+>
+
+])
+
+AT_CHECK([sed -e '1s/^From .*/Envelope/' \
+ -e '/^X-[[a-zA-Z]]*:/d' \
+ -e '/^Date:/d' record
+],
+[0],
+[Envelope
+To: "Alice" <alice@wonder.land>,"March Hare" <hare@wonder.land>,"Hatter" <hatter@example.org>
+Subject: Re: Invitation
+In-Reply-To: Your message of Mon, 29 Jul 2002 22:00:02 +0100
+ <200207292200.3302@wonder.land>
+References: <200207292200.3302@wonder.land>
+
+>To: March Hare <hare@wonder.land>
+>
+>I don't see any wine
+>
+
+])
+
+
+AT_CLEANUP
+
diff --git a/mail/tests/atlocal.in b/mail/tests/atlocal.in
index d68a03508..dfe1b0720 100644
--- a/mail/tests/atlocal.in
+++ b/mail/tests/atlocal.in
@@ -4,6 +4,7 @@
PATH=@abs_top_builddir@/testsuite:@abs_builddir@:@abs_top_builddir@/mail:$top_srcdir:$srcdir:$PATH
testsuitedir=@abs_top_srcdir@/testsuite
+MAILER=sendmail://@abs_top_builddir@/testsuite/mockmail
MALLOC_CHECK_=2
export MALLOC_CHECK_
catmbox() {
diff --git a/mail/tests/followup.at b/mail/tests/followup.at
new file mode 100644
index 000000000..cf55233cf
--- /dev/null
+++ b/mail/tests/followup.at
@@ -0,0 +1,148 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2015-2021 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_SETUP([followup])
+AT_KEYWORDS([followup])
+
+AT_DATA([inbox],
+[From hare@wonder.land Mon Jul 29 22:00:08 2002
+Received: (from hare@wonder.land)
+ by wonder.land id 3301
+ for alice@wonder.land; Mon, 29 Jul 2002 22:00:06 +0100
+Date: Mon, 29 Jul 2002 22:00:01 +0100
+From: March Hare <hare@wonder.land>
+Message-Id: <200207292200.3301@wonder.land>
+To: Alice <alice@wonder.land>
+Subject: Invitation
+
+Have some wine
+
+])
+
+AT_CHECK([touch record
+mkdir folder outfolder
+])
+
+AT_DATA([com],
+[set dot indentprefix=">"
+retain To
+followup 1
+~m
+.
+x
+])
+
+AT_CHECK([
+unset MAIL_DUMP
+MUT_MAIL_CMD -f ./inbox \
+ -E "set noheader" \
+ -E "set sendmail=$MAILER" \
+ -E "set record=$(pwd)/record" \
+ -E "set folder=$(pwd)/folder" \
+ -E "set outfolder" < com
+],
+[0],
+[To: "March Hare" <hare@wonder.land>,"Alice" <alice@wonder.land>
+Subject: Re: Invitation
+
+Interpolating: 1
+(continue)
+])
+
+AT_CHECK([
+sed -e '/^SENDER:/d' \
+ -e '/^Date:/d' \
+ -e '/^X-Mailer:/d' \
+ mail.dump],
+[0],
+[MSGID: 0001
+NRCPT: 2
+RCPT[[0]]: <hare@wonder.land>
+RCPT[[1]]: <alice@wonder.land>
+LENGTH: 356
+To: "March Hare" <hare@wonder.land>,"Alice" <alice@wonder.land>
+Subject: Re: Invitation
+In-Reply-To: Your message of Mon, 29 Jul 2002 22:00:01 +0100
+ <200207292200.3301@wonder.land>
+References: <200207292200.3301@wonder.land>
+
+>To: Alice <alice@wonder.land>
+>
+>Have some wine
+>
+
+])
+
+AT_CHECK([
+sed -e '1s/^From .*/Envelope/' \
+ -e '/^X-[[a-zA-Z]]*:/d' \
+ -e '/^Date:/d' folder/hare],
+[0],
+[Envelope
+To: "March Hare" <hare@wonder.land>,"Alice" <alice@wonder.land>
+Subject: Re: Invitation
+In-Reply-To: Your message of Mon, 29 Jul 2002 22:00:01 +0100
+ <200207292200.3301@wonder.land>
+References: <200207292200.3301@wonder.land>
+
+>To: Alice <alice@wonder.land>
+>
+>Have some wine
+>
+
+])
+
+#
+#
+#
+AT_CHECK([
+unset MAIL_DUMP
+MUT_MAIL_CMD -f ./inbox \
+ -E "set noheader" \
+ -E "set sendmail=$MAILER" \
+ -E "set record=$(pwd)/record" \
+ -E "set folder=$(pwd)/folder" \
+ -E "set outfolder=$(pwd)/outfolder" < com
+],
+[0],
+[To: "March Hare" <hare@wonder.land>,"Alice" <alice@wonder.land>
+Subject: Re: Invitation
+
+Interpolating: 1
+(continue)
+])
+
+AT_CHECK([
+sed -e '1s/^From .*/Envelope/' \
+ -e '/^X-[[a-zA-Z]]*:/d' \
+ -e '/^Date:/d' outfolder/hare],
+[0],
+[Envelope
+To: "March Hare" <hare@wonder.land>,"Alice" <alice@wonder.land>
+Subject: Re: Invitation
+In-Reply-To: Your message of Mon, 29 Jul 2002 22:00:01 +0100
+ <200207292200.3301@wonder.land>
+References: <200207292200.3301@wonder.land>
+
+>To: Alice <alice@wonder.land>
+>
+>Have some wine
+>
+
+])
+
+AT_CLEANUP
+
diff --git a/mail/tests/reply.at b/mail/tests/reply.at
new file mode 100644
index 000000000..45542c9d6
--- /dev/null
+++ b/mail/tests/reply.at
@@ -0,0 +1,109 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2015-2021 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_SETUP([reply])
+AT_KEYWORDS([reply])
+
+AT_DATA([inbox],
+[From hare@wonder.land Mon Jul 29 22:00:08 2002
+Received: (from hare@wonder.land)
+ by wonder.land id 3301
+ for alice@wonder.land; Mon, 29 Jul 2002 22:00:06 +0100
+Date: Mon, 29 Jul 2002 22:00:01 +0100
+From: March Hare <hare@wonder.land>
+Message-Id: <200207292200.3301@wonder.land>
+To: Alice <alice@wonder.land>
+Subject: Invitation
+
+Have some wine
+
+])
+
+AT_CHECK([touch record
+mkdir folder outfolder
+])
+
+AT_CHECK([
+AT_DATA([com],
+[set dot indentprefix=">"
+retain To
+reply 1
+~m
+.
+x
+])
+
+unset MAIL_DUMP
+MUT_MAIL_CMD -f ./inbox \
+ -E "set noheader" \
+ -E "set sendmail=$MAILER" \
+ -E "set record=$(pwd)/record" \
+ -E "set folder=$(pwd)/folder" \
+ -E "set outfolder" < com
+],
+[0],
+[To: "March Hare" <hare@wonder.land>,"Alice" <alice@wonder.land>
+Subject: Re: Invitation
+
+Interpolating: 1
+(continue)
+])
+
+AT_CHECK([
+sed -e '/^SENDER:/d' \
+ -e '/^Date:/d' \
+ -e '/^X-Mailer:/d' \
+ mail.dump],
+[0],
+[MSGID: 0001
+NRCPT: 2
+RCPT[[0]]: <hare@wonder.land>
+RCPT[[1]]: <alice@wonder.land>
+LENGTH: 356
+To: "March Hare" <hare@wonder.land>,"Alice" <alice@wonder.land>
+Subject: Re: Invitation
+In-Reply-To: Your message of Mon, 29 Jul 2002 22:00:01 +0100
+ <200207292200.3301@wonder.land>
+References: <200207292200.3301@wonder.land>
+
+>To: Alice <alice@wonder.land>
+>
+>Have some wine
+>
+
+])
+
+AT_CHECK([
+sed -e '1s/^From .*/Envelope/' \
+ -e '/^X-[[a-zA-Z]]*:/d' \
+ -e '/^Date:/d' record],
+[0],
+[Envelope
+To: "March Hare" <hare@wonder.land>,"Alice" <alice@wonder.land>
+Subject: Re: Invitation
+In-Reply-To: Your message of Mon, 29 Jul 2002 22:00:01 +0100
+ <200207292200.3301@wonder.land>
+References: <200207292200.3301@wonder.land>
+
+>To: Alice <alice@wonder.land>
+>
+>Have some wine
+>
+
+])
+
+AT_CLEANUP
+
diff --git a/mail/tests/send.at b/mail/tests/send.at
new file mode 100644
index 000000000..89053b0ed
--- /dev/null
+++ b/mail/tests/send.at
@@ -0,0 +1,45 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2015-2021 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_SETUP([send])
+
+AT_DATA([text],
+[Test message.
+Bye.
+])
+
+AT_CHECK([unset MAIL_DUMP
+MUT_MAIL_CMD -E "set sendmail=$MAILER" -s 'Test 22.1' gray@example.org < text
+sed -e '/^SENDER:/d' \
+ -e '/^Date:/d' \
+ -e '/^X-Mailer:/d' mail.dump],
+[0],
+[MSGID: 0001
+NRCPT: 1
+RCPT[[0]]: <gray@example.org>
+LENGTH: 139
+Subject: Test 22.1
+To: <gray@example.org>
+
+Test message.
+Bye.
+
+])
+
+AT_CLEANUP
+
+
+
diff --git a/mail/tests/sendbyname.at b/mail/tests/sendbyname.at
new file mode 100644
index 000000000..f8680085f
--- /dev/null
+++ b/mail/tests/sendbyname.at
@@ -0,0 +1,119 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2015-2021 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_SETUP([send -F])
+
+AT_DATA([text],
+[Test message.
+Bye.
+])
+
+#
+# Send with record by name
+#
+AT_CHECK([touch record
+mkdir folder outfolder
+])
+
+AT_CHECK([unset MAIL_DUMP
+MUT_MAIL_CMD -E "set sendmail=$MAILER" \
+ -E "set record=$(pwd)/record" \
+ -E "set folder=$(pwd)/folder" \
+ -E "set outfolder" \
+ -F \
+ -s 'Test 22.3' gray@example.org < text
+])
+
+AT_CHECK([
+sed -e '/^SENDER:/d' \
+ -e '/^Date:/d' \
+ -e '/^X-Mailer:/d' mail.dump],
+[0],
+[MSGID: 0001
+NRCPT: 1
+RCPT[[0]]: <gray@example.org>
+LENGTH: 139
+Subject: Test 22.3
+To: <gray@example.org>
+
+Test message.
+Bye.
+
+])
+
+AT_CHECK([cat record])
+
+AT_CHECK([
+sed -e '1s/^From .*/Envelope/' \
+ -e '/^X-[[a-zA-Z]]*:/d' \
+ -e '/^Date:/d' folder/gray],
+[0],
+[Envelope
+Subject: Test 22.3
+To: <gray@example.org>
+
+Test message.
+Bye.
+
+])
+
+#
+# Send with record by name
+#
+AT_CHECK([unset MAIL_DUMP
+MUT_MAIL_CMD -E "set sendmail=$MAILER" \
+ -E "set record=$(pwd)/record" \
+ -E "set folder=$(pwd)/folder" \
+ -E "set outfolder=$(pwd)/outfolder" \
+ -F \
+ -s 'Test 22.3' gray@example.org < text
+])
+
+AT_CHECK([
+sed -e '/^SENDER:/d' \
+ -e '/^Date:/d' \
+ -e '/^X-Mailer:/d' mail.dump],
+[0],
+[MSGID: 0001
+NRCPT: 1
+RCPT[[0]]: <gray@example.org>
+LENGTH: 139
+Subject: Test 22.3
+To: <gray@example.org>
+
+Test message.
+Bye.
+
+])
+
+AT_CHECK([cat record])
+
+AT_CHECK([
+sed -e '1s/^From .*/Envelope/' \
+ -e '/^X-[[a-zA-Z]]*:/d' \
+ -e '/^Date:/d' outfolder/gray record],
+[0],
+[Envelope
+Subject: Test 22.3
+To: <gray@example.org>
+
+Test message.
+Bye.
+
+])
+
+AT_CLEANUP
+
diff --git a/mail/tests/sendrec.at b/mail/tests/sendrec.at
new file mode 100644
index 000000000..8f0dcf79e
--- /dev/null
+++ b/mail/tests/sendrec.at
@@ -0,0 +1,64 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2015-2021 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_SETUP([send (record)])
+
+AT_DATA([text],
+[Test message.
+Bye.
+])
+
+#
+# Send with record
+#
+AT_CHECK([unset MAIL_DUMP
+RECORD=$(pwd)/record
+MUT_MAIL_CMD -E "set sendmail=$MAILER" -E "set record=$RECORD" -s 'Test 22.2' gray@example.org < text
+])
+
+AT_CHECK([
+sed -e '/^SENDER:/d' \
+ -e '/^Date:/d' \
+ -e '/^X-Mailer:/d' mail.dump],
+[0],
+[MSGID: 0001
+NRCPT: 1
+RCPT[[0]]: <gray@example.org>
+LENGTH: 139
+Subject: Test 22.2
+To: <gray@example.org>
+
+Test message.
+Bye.
+
+])
+
+AT_CHECK([
+sed -e '1s/^From .*/Envelope/' \
+ -e '/^X-[[a-zA-Z]]*:/d' \
+ -e '/^Date:/d' record],
+[0],
+[Envelope
+Subject: Test 22.2
+To: <gray@example.org>
+
+Test message.
+Bye.
+
+])
+
+AT_CLEANUP
+
diff --git a/mail/tests/testsuite.at b/mail/tests/testsuite.at
index 4e785fd61..972d19e75 100644
--- a/mail/tests/testsuite.at
+++ b/mail/tests/testsuite.at
@@ -33,3 +33,13 @@ m4_include([copy04.at])
m4_include([align.at])
m4_include([D.at])
m4_include([hold.at])
+
+AT_BANNER([Sending and replying])
+m4_include([send.at])
+m4_include([sendrec.at])
+m4_include([sendbyname.at])
+
+m4_include([reply.at])
+m4_include([Reply.at])
+m4_include([followup.at])
+m4_include([Followup.at])

Return to:

Send suggestions and report system problems to the System administrator.