aboutsummaryrefslogtreecommitdiff
path: root/tests/hdel01.at
diff options
context:
space:
mode:
Diffstat (limited to 'tests/hdel01.at')
-rw-r--r--tests/hdel01.at127
1 files changed, 127 insertions, 0 deletions
diff --git a/tests/hdel01.at b/tests/hdel01.at
new file mode 100644
index 0000000..b4ce4eb
--- /dev/null
+++ b/tests/hdel01.at
@@ -0,0 +1,127 @@
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([Remove headers from all messages])
17AT_KEYWORDS([header remove])
18AT_ANUBIS_CONFIG([anubis.rc],
19[BEGIN CONTROL
20logfile $PWD/etc/anubis.log
21local-mta $abs_builddir/mta -bs -d $PWD/etc/mta.log
22use-pam no
23END
24
25BEGIN RULE
26remove :re [["^X-.*"]]
27END
28])
29AT_DATA([input],
30[HELO localhost
31MAIL FROM:<gray@gnu.org>
32RCPT TO:<polak@gnu.org>
33DATA
34From: <gray@gnu.org>
35To: <polak@gnu.org>
36X-Subject: Test of header removal. Message 1.
37Subject: The Tao of Programming, Part I
38X-Part-Number: I
39
40 A manager went to his programmers and told them: "As regards to your
41work hours: you are going to have to come in at nine in the morning and leave
42at five in the afternoon." At this, all of them became angry and several
43resigned on the spot.
44 So the manager said: "All right, in that case you may set your own
45working hours, as long as you finish your projects on schedule." The
46programmers, now satisfied, began to come in a noon and work to the wee
47hours of the morning.
48.
49MAIL FROM:<gray@gnu.org>
50RCPT TO:<polak@gnu.org>
51DATA
52From: <gray@gnu.org>
53To: <polak@gnu.org>
54X-Subject: Test of header removal. Message 2.
55Subject: The Tao of Programming, Part II
56X-Part-Number: 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>
74X-Subject: Test of header removal. Message 3.
75Subject: The Tao of Programming, Part III
76X-Part-Number: III
77
78 A novice asked the Master: "Here is a programmer that never designs,
79documents, or tests his programs. Yet all who know him consider him one of
80the best programmers in the world. Why is this?"
81 The Master replies: "That programmer has mastered the Tao. He has
82gone beyond the need for design; he does not become angry when the system
83crashes, but accepts the universe without concern. He has gone beyond the
84need for documentation; he no longer cares if anyone else sees his code. He
85has gone beyond the need for testing; each of his programs are perfect within
86themselves, serene and elegant, their purpose self-evident. Truly, he has
87entered the mystery of the Tao."
88.
89QUIT
90])
91AT_CHECK([
92anubis --norc --relax-perm-check --altrc etc/anubis.rc --stdio < input | tr -d '\r'
93],
94[0],
95[220 localhost ([GNU Anubis v]AT_PACKAGE_VERSION) bitbucket ready
96250 pleased to meet you
97250 Sender OK
98250 Recipient OK
99354 Enter mail, end with "." on a line by itself
100250 Mail accepted for delivery
101250 Sender OK
102250 Recipient OK
103354 Enter mail, end with "." on a line by itself
104250 Mail accepted for delivery
105250 Sender OK
106250 Recipient OK
107354 Enter mail, end with "." on a line by itself
108250 Mail accepted for delivery
109221 Done
110],
111[ignore])
112AT_CHECK([diff input etc/mta.log],
113[1],
114[7d6
115< X-Subject: Test of header removal. Message 1.
1169d7
117< X-Part-Number: I
11825d22
119< X-Subject: Test of header removal. Message 2.
12027d23
121< X-Part-Number: II
12245d40
123< X-Subject: Test of header removal. Message 3.
12447d41
125< X-Part-Number: III
126])
127AT_CLEANUP

Return to:

Send suggestions and report system problems to the System administrator.