aboutsummaryrefslogtreecommitdiff
path: root/tests/hadd02.at
diff options
context:
space:
mode:
Diffstat (limited to 'tests/hadd02.at')
-rw-r--r--tests/hadd02.at115
1 files changed, 115 insertions, 0 deletions
diff --git a/tests/hadd02.at b/tests/hadd02.at
new file mode 100644
index 0000000..cbbf165
--- /dev/null
+++ b/tests/hadd02.at
@@ -0,0 +1,115 @@
1# This file is part of GNU Anubis testsuite. -*- autotest -*-
2# Copyright (C) 2003-2024 The Anubis Team.
3#
4# GNU Anubis is free software; you can redistribute it and/or modify it
5# under the terms of the GNU General Public License as published by the Free
6# Software Foundation; either version 3 of the License, or (at your option)
7# any later version.
8#
9# GNU Anubis is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with GNU Anubis. If not, see <http://www.gnu.org/licenses/>.
16AT_SETUP([Add header to selected messages])
17AT_KEYWORDS([hadd header])
18
19AT_ANUBIS_CONFIG([anubis.rc],
20[BEGIN CONTROL
21logfile $PWD/etc/anubis.log
22local-mta $abs_builddir/mta -bs -d $PWD/etc/mta.log
23use-pam no
24END
25
26BEGIN RULE
27if header[[Subject]] = ".*Part (.*)"
28 add [[X-Part-Number]] "\1"
29fi
30END
31])
32
33AT_DATA([input],
34[HELO localhost
35MAIL FROM:<gray@gnu.org>
36RCPT TO:<polak@gnu.org>
37DATA
38From: <gray@gnu.org>
39To: <polak@gnu.org>
40Subject: The Tao of Programming, Chapter I
41
42 A manager went to his programmers and told them: "As regards to your
43work hours: you are going to have to come in at nine in the morning and leave
44at five in the afternoon." At this, all of them became angry and several
45resigned on the spot.
46 So the manager said: "All right, in that case you may set your own
47working hours, as long as you finish your projects on schedule." The
48programmers, now satisfied, began to come in a noon and work to the wee
49hours of the morning.
50.
51MAIL FROM:<gray@gnu.org>
52RCPT TO:<polak@gnu.org>
53DATA
54From: <gray@gnu.org>
55To: <polak@gnu.org>
56Subject: The Tao of Programming, Part II
57
58 A master was explaining the nature of the Tao to one of his novices,
59"The Tao is embodied in all software -- regardless of how insignificant,"
60said the master.
61 "Is the Tao in a hand-held calculator?" asked the novice.
62 "It is," came the reply.
63 "Is the Tao in a video game?" continued the novice.
64 "It is even in a video game," said the master.
65 "And is the Tao in the DOS for a personal computer?"
66 The master coughed and shifted his position slightly. "The lesson is
67over for today," he said.
68.
69MAIL FROM:<gray@gnu.org>
70RCPT TO:<polak@gnu.org>
71DATA
72From: <gray@gnu.org>
73To: <polak@gnu.org>
74Subject: The Tao of Programming, Section III
75
76 A novice asked the Master: "Here is a programmer that never designs,
77documents, or tests his programs. Yet all who know him consider him one of
78the best programmers in the world. Why is this?"
79 The Master replies: "That programmer has mastered the Tao. He has
80gone beyond the need for design; he does not become angry when the system
81crashes, but accepts the universe without concern. He has gone beyond the
82need for documentation; he no longer cares if anyone else sees his code. He
83has gone beyond the need for testing; each of his programs are perfect within
84themselves, serene and elegant, their purpose self-evident. Truly, he has
85entered the mystery of the Tao."
86.
87QUIT
88])
89AT_CHECK([
90anubis --norc --relax-perm-check --altrc etc/anubis.rc --stdio < input | tr -d '\r'
91],
92[0],
93[220 localhost ([GNU Anubis v]AT_PACKAGE_VERSION) bitbucket ready
94250 pleased to meet you
95250 Sender OK
96250 Recipient OK
97354 Enter mail, end with "." on a line by itself
98250 Mail accepted for delivery
99250 Sender OK
100250 Recipient OK
101354 Enter mail, end with "." on a line by itself
102250 Mail accepted for delivery
103250 Sender OK
104250 Recipient OK
105354 Enter mail, end with "." on a line by itself
106250 Mail accepted for delivery
107221 Done
108],
109[ignore])
110AT_CHECK([diff input etc/mta.log],
111[1],
112[23a24
113> X-Part-Number: II
114])
115AT_CLEANUP

Return to:

Send suggestions and report system problems to the System administrator.