Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / mailscanner.aug
1 (*
2 Module: Mailscanner
3   Parses MailScanner configuration files.
4
5 Author: Andrew Colin Kissa <andrew@topdog.za.net>
6   Baruwa Enterprise Edition http://www.baruwa.com
7
8 About: License
9   This file is licensed under the LGPL v2+.
10
11 About: Configuration files
12   This lens applies to /etc/MailScanner/MailScanner.conf and files in 
13   /etc/MailScanner/conf.d/. See <filter>.
14 *)
15
16 module Mailscanner =
17 autoload xfm
18
19 (************************************************************************
20  * Group: USEFUL PRIMITIVES
21  *************************************************************************)
22 let comment  = Util.comment
23
24 let empty = Util.empty
25
26 let space = Sep.space
27
28 let eol = Util.eol
29
30 let non_eq = /[^ =\t\r\n]+/
31
32 let non_space = /[^# \t\n]/
33
34 let any = /.*/
35
36 let word = /[A-Za-z%][ :<>%A-Za-z0-9_.-]+[A-Za-z%2]/
37
38 let include_kw = /include/
39
40 let keys = word - include_kw
41
42 let eq         = del /[ \t]*=/ " ="
43
44 let indent     = del /[ \t]*(\n[ \t]+)?/ " "
45
46 let line_value = store (non_space . any .  non_space | non_space)
47
48 (************************************************************************
49  * Group: Entries 
50  *************************************************************************)
51
52 let include_line = Build.key_value_line include_kw space (store non_eq)
53
54 let normal_line = [ key keys . eq . (indent . line_value)? . eol ]
55
56 (************************************************************************
57  * Group: Lns and Filter
58  *************************************************************************)
59
60 let lns = (empty|include_line|normal_line|comment) *
61
62 let filter = (incl "/etc/MailScanner/MailScanner.conf")
63             . (incl "/etc/MailScanner/conf.d/*.conf")
64
65 let xfm = transform lns filter