smtp-server/resources/tests/config/if-blocks.toml

41 lines
1 KiB
TOML
Raw Normal View History

2022-12-13 18:19:41 +00:00
durations = [
2022-12-23 18:03:27 +00:00
{if = "sender", eq = "jdoe", then = "5d"},
{any-of = [{if = "priority", eq = -1}, {if = "rcpt", starts-with = "jane"}], then = "1h"},
2022-12-13 18:19:41 +00:00
{else = false}
]
string-list = [
2022-12-23 18:03:27 +00:00
{if = "sender", eq = "jdoe", then = ["From", "To", "Date"]},
{any-of = [{if = "priority", eq = -1}, {if = "rcpt", starts-with = "jane"}], then = "Other-ID"},
2022-12-13 18:19:41 +00:00
{else = []}
]
string-list-bis = [
2022-12-23 18:03:27 +00:00
{if = "sender", eq = "jdoe", then = ["From", "To", "Date"]},
{any-of = [{if = "priority", eq = -1}, {if = "rcpt", starts-with = "jane"}], then = []},
2022-12-13 18:19:41 +00:00
{else = ["ID-Bis"]}
]
single-value = "hello world"
bad-multi-value = [
2022-12-23 18:03:27 +00:00
{if = "sender", eq = "jdoe", then = 100},
{any-of = [{if = "priority", eq = -1}, {if = "rcpt", starts-with = "jane"}], then = [1, 2, 3]},
2022-12-13 18:19:41 +00:00
{else = 2}
]
bad-if-without-then = [
2022-12-23 18:03:27 +00:00
{if = "sender", eq = "jdoe"},
2022-12-13 18:19:41 +00:00
{else = 1}
]
bad-if-without-else = [
2022-12-23 18:03:27 +00:00
{if = "sender", eq = "jdoe", then = 1}
2022-12-13 18:19:41 +00:00
]
bad-multiple-else = [
2022-12-23 18:03:27 +00:00
{if = "sender", eq = "jdoe", then = 1},
2022-12-13 18:19:41 +00:00
{else = 1},
{else = 2}
]