[augeas-devel] [PATCH] Postfix_master: allow commas in commands

Michael Chapman mike at very.puzzling.org
Wed Sep 28 03:05:56 UTC 2011


Postfix daemons accept "-o name=value" to override main.cf configuration
parameters, and the value can be a comma-separated value list.

Signed-off-by: Michael Chapman <mike at very.puzzling.org>
---
 lenses/postfix_master.aug            |    2 +-
 lenses/tests/test_postfix_master.aug |   16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/lenses/postfix_master.aug b/lenses/postfix_master.aug
index 6b4259e..d56578d 100644
--- a/lenses/postfix_master.aug
+++ b/lenses/postfix_master.aug
@@ -19,7 +19,7 @@ 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 words      = /[A-Za-z0-9$(){}=!_.,-][A-Za-z0-9$!(){} ="\/_.,-]*[A-Za-z0-9$!(){}="\/_.,-]/
 
 let bool       = /y|n|-/
 let integer    = /([0-9]+|-)\??/
diff --git a/lenses/tests/test_postfix_master.aug b/lenses/tests/test_postfix_master.aug
index c3fe473..d6fd14f 100644
--- a/lenses/tests/test_postfix_master.aug
+++ b/lenses/tests/test_postfix_master.aug
@@ -43,3 +43,19 @@ test Postfix_Master.lns get conf2 =
     { "command" = "pipe\n  flags=R user=cyrus argv=/usr/sbin/cyrdeliver -e -m \"${extension}\" ${user}" }
   }
 
+(* accept commas in arguments *)
+let conf3 = "# master.cf
+submission inet n       -       n       -       -       smtpd
+  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
+"
+
+test Postfix_Master.lns get conf3 =
+   { "#comment" = "master.cf" }
+   { "submission"
+     { "type" = "inet" }
+     { "private" = "n" }
+     { "unpriviliged" = "-" }
+     { "chroot" = "n" }
+     { "wakeup" = "-" }
+     { "limit" = "-" }
+     { "command" = "smtpd\n  -o smtpd_client_restrictions=permit_sasl_authenticated,reject" } }
-- 
1.7.6.2




More information about the augeas-devel mailing list