All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.augeas-lenses.postfix_master.aug Maven / Gradle / Ivy

There is a newer version: 4.13.0
Show newest version
(* Postfix_Master module for Augeas
 Author: Free Ekanayaka 

 Reference:

*)

module Postfix_Master =

   autoload xfm

(************************************************************************
 *                           USEFUL PRIMITIVES
 *************************************************************************)

let eol        = Util.eol
let ws         = del /[ \t\n]+/ " "
let comment    = Util.comment
let empty      = Util.empty

let word       = /[A-Za-z0-9_.-]+/
let words      = /[A-Za-z0-9$(){}=!_.-][A-Za-z0-9$!(){} =\/_.-]*[A-Za-z0-9$!(){}=\/_.-]/

let bool       = /y|n|-/
let integer    = /([0-9]+|-)\??/
let command   = words . (/\n[ \t]+/ . words)*

let field (l:string) (r:regexp)
               = [ label l . store r ]

(************************************************************************
 *                               ENTRIES
 *************************************************************************)

let entry     = [ key word . ws
                . field "type"         /inet|unix|fifo|pass/  . ws
                . field "private"      bool                   . ws
                . field "unpriviliged" bool                   . ws
                . field "chroot"       bool                   . ws
                . field "wakeup"       integer                . ws
                . field "limit"        integer                . ws
                . field "command"      command
                . eol ]

(************************************************************************
 *                                LENS
 *************************************************************************)

let lns        = (comment|empty|entry) *

let filter     = incl "/etc/postfix/master.cf"
               . Util.stdexcl

let xfm        = transform lns filter




© 2015 - 2024 Weber Informatics LLC | Privacy Policy