diff options
Diffstat (limited to 'tests/paolo.at')
-rw-r--r-- | tests/paolo.at | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/tests/paolo.at b/tests/paolo.at new file mode 100644 index 0000000..82da354 --- /dev/null +++ b/tests/paolo.at | |||
@@ -0,0 +1,72 @@ | |||
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([Removing substrings from the body]) | ||
17 | AT_ANUBIS_CONFIG([anubis.rc], | ||
18 | [BEGIN CONTROL | ||
19 | logfile $PWD/etc/anubis.log | ||
20 | local-mta $abs_builddir/mta -bs -d $PWD/etc/mta.log | ||
21 | use-pam no | ||
22 | END | ||
23 | |||
24 | BEGIN RULE | ||
25 | modify body :extended [["[[:blank:]]*X-Anomy:.*"]] "" | ||
26 | modify body :extended [["X-Paren\\\\([^)]*\\\\)"]] "" | ||
27 | END | ||
28 | ]) | ||
29 | AT_DATA([input], | ||
30 | [HELO localhost | ||
31 | MAIL FROM:<gray@gnu.org> | ||
32 | RCPT TO:<polak@gnu.org> | ||
33 | DATA | ||
34 | From: <gray@gnu.org> | ||
35 | To: <polak@gnu.org> | ||
36 | Subject: Removing substrings from the body | ||
37 | |||
38 | X-Anomy: This string is removed entirely | ||
39 | This line is left untouched | ||
40 | This X-Paren(garbage)lineX-Paren(text) has some garX-Paren(or more)bage removed | ||
41 | |||
42 | Regards, | ||
43 | Sergey | ||
44 | . | ||
45 | QUIT | ||
46 | ]) | ||
47 | AT_DATA([expout], | ||
48 | [HELO localhost | ||
49 | MAIL FROM:<gray@gnu.org> | ||
50 | RCPT TO:<polak@gnu.org> | ||
51 | DATA | ||
52 | From: <gray@gnu.org> | ||
53 | To: <polak@gnu.org> | ||
54 | Subject: Removing substrings from the body | ||
55 | |||
56 | |||
57 | This line is left untouched | ||
58 | This line has some garbage removed | ||
59 | |||
60 | Regards, | ||
61 | Sergey | ||
62 | . | ||
63 | QUIT | ||
64 | ]) | ||
65 | AT_CHECK([ | ||
66 | anubis --norc --relax-perm-check --altrc etc/anubis.rc --stdio < input | tr -d '\r' | ||
67 | ], | ||
68 | [0], | ||
69 | [ignore], | ||
70 | [ignore]) | ||
71 | AT_CHECK([cat etc/mta.log],[0],[expout]) | ||
72 | AT_CLEANUP | ||