From c07918c1f020e45367075c9a84a4d33587bbe469 Mon Sep 17 00:00:00 2001 From: Giacomo Tenaglia Date: Wed, 7 Feb 2024 22:19:51 +0100 Subject: [PATCH] Extend canonical augeas lens regex (fixes #345) --- lib/augeas/lenses/postfix_canonical.aug | 2 +- lib/augeas/lenses/test_postfix_canonical.aug | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/augeas/lenses/postfix_canonical.aug b/lib/augeas/lenses/postfix_canonical.aug index f8e991ed..8316c15d 100644 --- a/lib/augeas/lenses/postfix_canonical.aug +++ b/lib/augeas/lenses/postfix_canonical.aug @@ -32,7 +32,7 @@ let space_or_eol (sep:regexp) (default:string) = del (space_or_eol_re? . sep . space_or_eol_re?) default (* View: word *) -let word = store /[A-Za-z0-9@\*.+-]+/ +let word = store /[A-Za-z0-9@\*.+-_!$&'=?^`{|}~]+/ (* View: comma *) let comma = space_or_eol "," ", " diff --git a/lib/augeas/lenses/test_postfix_canonical.aug b/lib/augeas/lenses/test_postfix_canonical.aug index 2e6d1079..2f2956d0 100644 --- a/lib/augeas/lenses/test_postfix_canonical.aug +++ b/lib/augeas/lenses/test_postfix_canonical.aug @@ -10,6 +10,7 @@ let conf = "# a comment user@domain.com @domain @otherdomain @otherotherdomain someuser Full.Some.User +anotheruser another_user+mail=address@domain " (* Test: Postfix_Canonical.lns *) @@ -24,3 +25,6 @@ test Postfix_Canonical.lns get conf = { "pattern" = "someuser" { "destination" = "Full.Some.User" } } + { "pattern" = "anotheruser" + { "destination" = "another_user+mail=address@domain" } + }