2 Module: Postfix_Transport
3 Parses /etc/postfix/transport
5 Author: Raphael Pinson <raphael.pinson@camptocamp.com>
8 This lens tries to keep as close as possible to `man 5 transport` 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/transport. See <filter>.
20 The <Test_Postfix_Transport> file contains various examples and tests.
23 module Postfix_Transport =
27 (* View: space_or_eol *)
28 let space_or_eol = del /([ \t]*\n)?[ \t]+/ " "
35 let host_re = "[" . Rx.word . "]" | /[A-Za-z]([^\n]*[^ \t\n])?/
36 in [ label "nexthop" . (store host_re)? ]
39 let transport = [ label "transport" . (store Rx.word)? ]
42 (* View: nexthop_smtp *)
44 let host_re = "[" . Rx.word . "]" | Rx.word
45 in [ label "host" . store host_re ]
47 . [ label "port" . store Rx.integer ]
50 let record = [ label "pattern" . store /[A-Za-z0-9@\*.-]+/
51 . space_or_eol . (transport | nexthop_smtp)
55 let lns = (Util.empty | Util.comment | record)*
57 (* Variable: filter *)
58 let filter = incl "/etc/postfix/transport"
59 . incl "/usr/local/etc/postfix/transport"
61 let xfm = transform lns filter