diff options
Diffstat (limited to 'tests/fadd.at')
-rw-r--r-- | tests/fadd.at | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/tests/fadd.at b/tests/fadd.at new file mode 100644 index 0000000..665bfa0 --- /dev/null +++ b/tests/fadd.at | |||
@@ -0,0 +1,79 @@ | |||
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 a text file to the message body]) | ||
17 | AT_KEYWORDS([add body file]) | ||
18 | |||
19 | AT_DATA([append.txt], | ||
20 | [Behind the curtain, in the pantomime | ||
21 | Hold the line, does anybody want to take it anymore | ||
22 | The show must go on, | ||
23 | The show must go on... | ||
24 | ]) | ||
25 | |||
26 | AT_ANUBIS_CONFIG([anubis.rc], | ||
27 | [BEGIN CONTROL | ||
28 | logfile $PWD/etc/anubis.log | ||
29 | local-mta $abs_builddir/mta -bs -d $PWD/etc/mta.log | ||
30 | use-pam no | ||
31 | END | ||
32 | |||
33 | BEGIN RULE | ||
34 | if header[[X-Order]] = "Append file" | ||
35 | body-append "$PWD/append.txt" | ||
36 | fi | ||
37 | remove [[X-Command]] | ||
38 | END | ||
39 | ]) | ||
40 | |||
41 | AT_DATA([input], | ||
42 | [HELO localhost | ||
43 | MAIL FROM:<polak@gnu.org> | ||
44 | RCPT TO:<gray@gnu.org> | ||
45 | DATA | ||
46 | From: <polak@gnu.org> | ||
47 | To: <gray@gnu.org> | ||
48 | Subject: The Show Must Go On | ||
49 | X-Order: Append file | ||
50 | |||
51 | Empty spaces -- what are we living for | ||
52 | Abandoned places -- I guess we know the score | ||
53 | On and on, does anybody know what we are looking for... | ||
54 | Another hero, another mindless crime | ||
55 | . | ||
56 | QUIT | ||
57 | ]) | ||
58 | AT_CHECK([ | ||
59 | anubis --norc --relax-perm-check --altrc etc/anubis.rc --stdio < input | tr -d '\r' | ||
60 | ], | ||
61 | [0], | ||
62 | [220 localhost ([GNU Anubis v]AT_PACKAGE_VERSION) bitbucket ready | ||
63 | 250 pleased to meet you | ||
64 | 250 Sender OK | ||
65 | 250 Recipient OK | ||
66 | 354 Enter mail, end with "." on a line by itself | ||
67 | 250 Mail accepted for delivery | ||
68 | 221 Done | ||
69 | ], | ||
70 | [ignore]) | ||
71 | AT_CHECK([diff input etc/mta.log], | ||
72 | [1], | ||
73 | [13a14,17 | ||
74 | > Behind the curtain, in the pantomime | ||
75 | > Hold the line, does anybody want to take it anymore | ||
76 | > The show must go on, | ||
77 | > The show must go on... | ||
78 | ]) | ||
79 | AT_CLEANUP | ||