Blame lenses/postfix_virtual.aug
|
Packit Service |
a2ae7a |
(*
|
|
Packit Service |
a2ae7a |
Module: Postfix_Virtual
|
|
Packit Service |
a2ae7a |
Parses /etc/postfix/virtual
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
Author: Raphael Pinson <raphael.pinson@camptocamp.com>
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
About: Reference
|
|
Packit Service |
a2ae7a |
This lens tries to keep as close as possible to `man 5 virtual` where possible.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
About: License
|
|
Packit Service |
a2ae7a |
This file is licenced under the LGPL v2+, like the rest of Augeas.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
About: Lens Usage
|
|
Packit Service |
a2ae7a |
To be documented
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
About: Configuration files
|
|
Packit Service |
a2ae7a |
This lens applies to /etc/postfix/virtual. See <filter>.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
About: Examples
|
|
Packit Service |
a2ae7a |
The <Test_Postfix_Virtual> file contains various examples and tests.
|
|
Packit Service |
a2ae7a |
*)
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
module Postfix_Virtual =
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
autoload xfm
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Variable: space_or_eol_re *)
|
|
Packit Service |
a2ae7a |
let space_or_eol_re = /([ \t]*\n)?[ \t]+/
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* View: space_or_eol *)
|
|
Packit Service |
a2ae7a |
let space_or_eol (sep:regexp) (default:string) =
|
|
Packit Service |
a2ae7a |
del (space_or_eol_re? . sep . space_or_eol_re?) default
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* View: word *)
|
|
Packit Service |
a2ae7a |
let word = store /[A-Za-z0-9@\*.+=_-]+/
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* View: comma *)
|
|
Packit Service |
a2ae7a |
let comma = space_or_eol "," ", "
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* View: destination *)
|
|
Packit Service |
a2ae7a |
let destination = [ label "destination" . word ]
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* View: record *)
|
|
Packit Service |
a2ae7a |
let record =
|
|
Packit Service |
a2ae7a |
let destinations = Build.opt_list destination comma
|
|
Packit Service |
a2ae7a |
in [ label "pattern" . word
|
|
Packit Service |
a2ae7a |
. space_or_eol Rx.space " " . destinations
|
|
Packit Service |
a2ae7a |
. Util.eol ]
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* View: lns *)
|
|
Packit Service |
a2ae7a |
let lns = (Util.empty | Util.comment | record)*
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Variable: filter *)
|
|
Packit Service |
a2ae7a |
let filter = incl "/etc/postfix/virtual"
|
|
Packit Service |
a2ae7a |
. incl "/usr/local/etc/postfix/virtual"
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let xfm = transform lns filter
|