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

Return to:

Send suggestions and report system problems to the System administrator.