diff options
Diffstat (limited to 'tests/hadd02.at')
-rw-r--r-- | tests/hadd02.at | 115 |
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/>. | ||
16 | AT_SETUP([Add header to selected messages]) | ||
17 | AT_KEYWORDS([hadd header]) | ||
18 | |||
19 | AT_ANUBIS_CONFIG([anubis.rc], | ||
20 | [BEGIN CONTROL | ||
21 | logfile $PWD/etc/anubis.log | ||
22 | local-mta $abs_builddir/mta -bs -d $PWD/etc/mta.log | ||
23 | use-pam no | ||
24 | END | ||
25 | |||
26 | BEGIN RULE | ||
27 | if header[[Subject]] = ".*Part (.*)" | ||
28 | add [[X-Part-Number]] "\1" | ||
29 | fi | ||
30 | END | ||
31 | ]) | ||
32 | |||
33 | AT_DATA([input], | ||
34 | [HELO localhost | ||
35 | MAIL FROM:<gray@gnu.org> | ||
36 | RCPT TO:<polak@gnu.org> | ||
37 | DATA | ||
38 | From: <gray@gnu.org> | ||
39 | To: <polak@gnu.org> | ||
40 | Subject: The Tao of Programming, Chapter I | ||
41 | |||
42 | A manager went to his programmers and told them: "As regards to your | ||
43 | work hours: you are going to have to come in at nine in the morning and leave | ||
44 | at five in the afternoon." At this, all of them became angry and several | ||
45 | resigned on the spot. | ||
46 | So the manager said: "All right, in that case you may set your own | ||
47 | working hours, as long as you finish your projects on schedule." The | ||
48 | programmers, now satisfied, began to come in a noon and work to the wee | ||
49 | hours of the morning. | ||
50 | . | ||
51 | MAIL FROM:<gray@gnu.org> | ||
52 | RCPT TO:<polak@gnu.org> | ||
53 | DATA | ||
54 | From: <gray@gnu.org> | ||
55 | To: <polak@gnu.org> | ||
56 | Subject: 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," | ||
60 | said 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 | ||
67 | over for today," he said. | ||
68 | . | ||
69 | MAIL FROM:<gray@gnu.org> | ||
70 | RCPT TO:<polak@gnu.org> | ||
71 | DATA | ||
72 | From: <gray@gnu.org> | ||
73 | To: <polak@gnu.org> | ||
74 | Subject: The Tao of Programming, Section III | ||
75 | |||
76 | A novice asked the Master: "Here is a programmer that never designs, | ||
77 | documents, or tests his programs. Yet all who know him consider him one of | ||
78 | the best programmers in the world. Why is this?" | ||
79 | The Master replies: "That programmer has mastered the Tao. He has | ||
80 | gone beyond the need for design; he does not become angry when the system | ||
81 | crashes, but accepts the universe without concern. He has gone beyond the | ||
82 | need for documentation; he no longer cares if anyone else sees his code. He | ||
83 | has gone beyond the need for testing; each of his programs are perfect within | ||
84 | themselves, serene and elegant, their purpose self-evident. Truly, he has | ||
85 | entered the mystery of the Tao." | ||
86 | . | ||
87 | QUIT | ||
88 | ]) | ||
89 | AT_CHECK([ | ||
90 | anubis --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 | ||
94 | 250 pleased to meet you | ||
95 | 250 Sender OK | ||
96 | 250 Recipient OK | ||
97 | 354 Enter mail, end with "." on a line by itself | ||
98 | 250 Mail accepted for delivery | ||
99 | 250 Sender OK | ||
100 | 250 Recipient OK | ||
101 | 354 Enter mail, end with "." on a line by itself | ||
102 | 250 Mail accepted for delivery | ||
103 | 250 Sender OK | ||
104 | 250 Recipient OK | ||
105 | 354 Enter mail, end with "." on a line by itself | ||
106 | 250 Mail accepted for delivery | ||
107 | 221 Done | ||
108 | ], | ||
109 | [ignore]) | ||
110 | AT_CHECK([diff input etc/mta.log], | ||
111 | [1], | ||
112 | [23a24 | ||
113 | > X-Part-Number: II | ||
114 | ]) | ||
115 | AT_CLEANUP | ||