2 Module: Postfix_Virtual
3 Parses /etc/postfix/virtual
5 Author: Raphael Pinson <raphael.pinson@camptocamp.com>
8 This lens tries to keep as close as possible to `man 5 virtual` where possible.
11 This file is licenced under the LGPL v2+, like the rest of Augeas.
16 About: Configuration files
17 This lens applies to /etc/postfix/virtual. See <filter>.
20 The <Test_Postfix_Virtual> file contains various examples and tests.
23 module Postfix_Virtual =
27 (* Variable: space_or_eol_re *)
28 let space_or_eol_re = /([ \t]*\n)?[ \t]+/
30 (* View: space_or_eol *)
31 let space_or_eol (sep:regexp) (default:string) =
32 del (space_or_eol_re? . sep . space_or_eol_re?) default
35 let word = store /[A-Za-z0-9@\*.+=-]+/
38 let comma = space_or_eol "," ", "
40 (* View: destination *)
41 let destination = [ label "destination" . word ]
45 let destinations = Build.opt_list destination comma
46 in [ label "pattern" . word
47 . space_or_eol Rx.space " " . destinations
51 let lns = (Util.empty | Util.comment | record)*
53 (* Variable: filter *)
54 let filter = incl "/etc/postfix/virtual"
56 let xfm = transform lns filter