|
Packit Service |
a2ae7a |
(*
|
|
Packit Service |
a2ae7a |
Module: Mailscanner
|
|
Packit Service |
a2ae7a |
Parses MailScanner configuration files.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
Author: Andrew Colin Kissa <andrew@topdog.za.net>
|
|
Packit Service |
a2ae7a |
Baruwa Enterprise Edition http://www.baruwa.com
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
About: License
|
|
Packit Service |
a2ae7a |
This file is licensed under the LGPL v2+.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
About: Configuration files
|
|
Packit Service |
a2ae7a |
This lens applies to /etc/MailScanner/MailScanner.conf and files in
|
|
Packit Service |
a2ae7a |
/etc/MailScanner/conf.d/. See <filter>.
|
|
Packit Service |
a2ae7a |
*)
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
module Mailscanner =
|
|
Packit Service |
a2ae7a |
autoload xfm
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(************************************************************************
|
|
Packit Service |
a2ae7a |
* Group: USEFUL PRIMITIVES
|
|
Packit Service |
a2ae7a |
*************************************************************************)
|
|
Packit Service |
a2ae7a |
let comment = Util.comment
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let empty = Util.empty
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let space = Sep.space
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let eol = Util.eol
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let non_eq = /[^ =\t\r\n]+/
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let non_space = /[^# \t\n]/
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let any = /.*/
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let word = /[A-Za-z%][ :<>%A-Za-z0-9_.-]+[A-Za-z%2]/
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let include_kw = /include/
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let keys = word - include_kw
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let eq = del /[ \t]*=/ " ="
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let indent = del /[ \t]*(\n[ \t]+)?/ " "
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let line_value = store (non_space . any . non_space | non_space)
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(************************************************************************
|
|
Packit Service |
a2ae7a |
* Group: Entries
|
|
Packit Service |
a2ae7a |
*************************************************************************)
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let include_line = Build.key_value_line include_kw space (store non_eq)
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let normal_line = [ key keys . eq . (indent . line_value)? . eol ]
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(************************************************************************
|
|
Packit Service |
a2ae7a |
* Group: Lns and Filter
|
|
Packit Service |
a2ae7a |
*************************************************************************)
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let lns = (empty|include_line|normal_line|comment) *
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let filter = (incl "/etc/MailScanner/MailScanner.conf")
|
|
Packit Service |
a2ae7a |
. (incl "/etc/MailScanner/conf.d/*.conf")
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let xfm = transform lns filter
|