1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
# This file is part of GNU Anubis testsuite.
# Copyright (C) 2003-2014 The Anubis Team.
#
# GNU Anubis is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# GNU Anubis is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Anubis; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
:TEST parse
:MODE EXEC
:OPTIONS --check-config=1
:RCFILE std.rc
:RETCODE 0
:PATTERN
BEGIN SECTION CONTROL
ASGN: logfile = anubis.log
ASGN: remote-mta = localhost:25
ifdef(`WITH_SSL',` ASGN: ssl = yes
')`'dnl
END SECTION CONTROL
BEGIN SECTION RULE
ifdef(`WITH_GPG',` ASGN: gpg-passphrase = ***
')`'dnl
REMOVE HEADER :exact [Lines]
COND: COMMAND[mail from] :posix [.*<?root@localhost>?]
IFTRUE:
STOP
END COND
COND: AND (HEADER[Subject] :posix [(.*)],NOT (HEADER[Subject] :posix :scase [URGENT]))
IFTRUE:
ADD HEADER[X-Comment] "This message is not URGENT (\1)."
ADD HEADER[X-Comment] "GNU's Not Unix! (\1)"
END COND
COND: HEADER[X-Mailer] :posix [(.*)]
IFTRUE:
ADD HEADER[X-Comment] "My love \1"
MODIFY HEADER :exact [X-Mailer] "The lousy mailer \1"
END COND
RULE: HEADER :posix [gpgd:(.*)]
BODY
ADD HEADER[X-GPG-Comment] "Encrypted for \1"
ifdef(`WITH_GPG',` ASGN: gpg-encrypt = \1
')`'dnl
END RULE
COND: HEADER[Subject] :posix [signature]
IFTRUE:
ASGN: signature-file-append = yes
END COND
COND: HEADER[Subject] :posix :scase [external]
IFTRUE:
ASGN: external-body-processor = /usr/bin/formail
END COND
ifdef(`WITH_GPG',` COND: HEADER[Subject] :posix [gpg-all]
IFTRUE:
ASGN: gpg-encrypt = USERNAME
ASGN: gpg-sign = default
END COND
COND: HEADER[Subject] :posix [gpg-encrypt]
IFTRUE:
ASGN: gpg-encrypt = USERNAME-1,USERNAME-2,USERNAME-3
END COND
COND: HEADER[Subject] :posix [gpg-sign]
IFTRUE:
ASGN: gpg-sign = default
END COND
')`'dnl
ifdef(`WITH_GUILE',` COND: HEADER[Subject] :posix [rot13-all]
IFTRUE:
ASGN: guile-process = rot-13 #:body
ASGN: guile-process = rot-13 #:subject
END COND
COND: HEADER[Subject] :posix [rot13-body]
IFTRUE:
ASGN: guile-process = rot-13 #:body
END COND
COND: HEADER[Subject] :posix [rot13-subject]
IFTRUE:
ASGN: guile-process = rot-13 #:subject
END COND
')`'dnl
COND: HEADER[Subject] :posix [body-append]
IFTRUE:
ASGN: body-append = misc/notes.txt
END COND
COND: HEADER[Subject] :posix [ALL]
IFTRUE:
ASGN: body-append = misc/notes.txt
ifdef(`WITH_GPG',` ASGN: gpg-encrypt = USERNAME
')`'dnl
ifdef(`WITH_GUILE',` ASGN: guile-process = rot-13 #:body
ASGN: guile-process = rot-13 #:subject
')`'dnl
END COND
END SECTION RULE
:END PATTERN
:END TEST
|