Skip to content

Commit d926965

Browse files
committed
Make transport pattern accept regexp
1 parent f9a114b commit d926965

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

files/lenses/postfix_transport.aug

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ let transport = [ label "transport" . (store Rx.word)? ]
3737
let nexthop = [ label "nexthop" . (store Rx.space_in)? ]
3838

3939
(* View: record *)
40-
let record = [ label "pattern" . store /[A-Za-z0-9@\*.-]+/
40+
let record = [ label "pattern" . store /[^# \t\r\n]+/
4141
. space_or_eol . transport
4242
. colon . nexthop
4343
. Util.eol ]

files/lenses/test_postfix_transport.aug

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ example.com :[gateway.example.com]
1616
1717
smtp:bar.example:2025
1818
.example.com error:mail for *.example.com is not deliverable
19+
/^bounce\+.*/ sympabounce:
1920
"
2021

2122
(* Test: Postfix_Transport.lns *)
@@ -45,4 +46,8 @@ test Postfix_Transport.lns get conf =
4546
{ "pattern" = ".example.com"
4647
{ "transport" = "error" }
4748
{ "nexthop" = "mail for *.example.com is not deliverable" } }
49+
{ "pattern" = "/^bounce\+.*/"
50+
{ "transport" = "sympabounce" }
51+
{ "nexthop" } }
52+
4853

0 commit comments

Comments
 (0)