2 Module: Postfix_Passwordmap
3 Parses /etc/postfix/*passwd
5 Author: Anton Baranov <abaranov@linuxfoundation.org>
8 This lens tries to keep as close as possible to `man 5 postconf` and
9 http://www.postfix.org/SASL_README.html#client_sasl_enable where possible.
12 This file is licenced under the LGPL v2+, like the rest of Augeas.
14 About: Configuration files
15 This lens applies to /etc/postfix/*passwd. See <filter>.
18 The <Test_Postfix_Passwordmap> file contains various examples and tests.
21 module Postfix_Passwordmap =
25 (* View: space_or_eol *)
26 let space_or_eol = del /([ \t]*\n)?[ \t]+/ " "
29 let word = store /[A-Za-z0-9@_\+\*.-]+/
35 let username = [ label "username" . word ]
38 let password = [ label "password" . (store Rx.space_in)? ]
41 let record = [ label "pattern" . store /\[?[A-Za-z0-9@\*.-]+\]?(:?[A-Za-z0-9]*)*/
42 . space_or_eol . username . colon . password
46 let lns = (Util.empty | Util.comment | record)*
48 (* Variable: filter *)
49 let filter = incl "/etc/postfix/*passwd"
50 . incl "/usr/local/etc/postfix/*passwd"
52 let xfm = transform lns filter