1 (* Postfix_Master module for Augeas
2 Author: Free Ekanayaka <free@64studio.com>
8 module Postfix_Master =
12 (************************************************************************
14 *************************************************************************)
17 let ws = del /[ \t\n]+/ " "
18 let comment = Util.comment
19 let empty = Util.empty
21 let word = /[A-Za-z0-9_.:-]+/
23 let char_start = /[A-Za-z0-9$!(){}=_.,:@-]/
24 in let char_end = char_start | /[]["\/]/
25 in let char_middle = char_end | " "
26 in char_start . char_middle* . char_end
29 let integer = /([0-9]+|-)\??/
30 let command = words . (/[ \t]*\n[ \t]+/ . words)*
32 let field (l:string) (r:regexp)
33 = [ label l . store r ]
35 (************************************************************************
37 *************************************************************************)
39 let entry = [ key word . ws
40 . field "type" /inet|unix(-dgram)?|fifo|pass/ . ws
41 . field "private" bool . ws
42 . field "unprivileged" bool . ws
43 . field "chroot" bool . ws
44 . field "wakeup" integer . ws
45 . field "limit" integer . ws
46 . field "command" command
49 (************************************************************************
51 *************************************************************************)
53 let lns = (comment|empty|entry) *
55 let filter = incl "/etc/postfix/master.cf"
56 . incl "/usr/local/etc/postfix/master.cf"
58 let xfm = transform lns filter