Skip to content
Snippets Groups Projects
Commit d926965e authored by Raphaël Pinson's avatar Raphaël Pinson Committed by Raphaël Pinson
Browse files

Make transport pattern accept regexp

parent f9a114b2
No related branches found
No related tags found
No related merge requests found
...@@ -37,7 +37,7 @@ let transport = [ label "transport" . (store Rx.word)? ] ...@@ -37,7 +37,7 @@ let transport = [ label "transport" . (store Rx.word)? ]
let nexthop = [ label "nexthop" . (store Rx.space_in)? ] let nexthop = [ label "nexthop" . (store Rx.space_in)? ]
(* View: record *) (* View: record *)
let record = [ label "pattern" . store /[A-Za-z0-9@\*.-]+/ let record = [ label "pattern" . store /[^# \t\r\n]+/
. space_or_eol . transport . space_or_eol . transport
. colon . nexthop . colon . nexthop
. Util.eol ] . Util.eol ]
......
...@@ -16,6 +16,7 @@ example.com :[gateway.example.com] ...@@ -16,6 +16,7 @@ example.com :[gateway.example.com]
user.foo@example.com user.foo@example.com
smtp:bar.example:2025 smtp:bar.example:2025
.example.com error:mail for *.example.com is not deliverable .example.com error:mail for *.example.com is not deliverable
/^bounce\+.*/ sympabounce:
" "
(* Test: Postfix_Transport.lns *) (* Test: Postfix_Transport.lns *)
...@@ -45,4 +46,8 @@ test Postfix_Transport.lns get conf = ...@@ -45,4 +46,8 @@ test Postfix_Transport.lns get conf =
{ "pattern" = ".example.com" { "pattern" = ".example.com"
{ "transport" = "error" } { "transport" = "error" }
{ "nexthop" = "mail for *.example.com is not deliverable" } } { "nexthop" = "mail for *.example.com is not deliverable" } }
{ "pattern" = "/^bounce\+.*/"
{ "transport" = "sympabounce" }
{ "nexthop" } }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment