Use rustls-platform-verifier for TLS certificate verification instead of webpki + Use aws-lc for cryptographic operations instead of ring

This commit is contained in:
Maurus Decimus
2026-04-04 12:23:30 +02:00
parent c44d3da6dc
commit 71f54f7e84
80 changed files with 1921 additions and 2198 deletions

View File

@@ -1,34 +0,0 @@
durations = [
{if = "sender = 'jdoe'", then = "5d"},
{if = "priority = -1 | starts_with(rcpt, 'jane')", then = "1h"},
{else = false}
]
string-list = [
{if = "sender = 'jdoe'", then = "['From', 'To', 'Date']"},
{if = "priority = -1 | starts_with(rcpt, 'jane')", then = "'Other-ID'"},
{else = "[]"}
]
string-list-bis = [
{if = "sender = 'jdoe'", then = "['From', 'To', 'Date']"},
{if = "priority = -1 | starts_with(rcpt, 'jane')", then = "[]"},
{else = "['ID-Bis']"}
]
single-value = "'hello world'"
bad-if-without-then = [
{if = "sender = 'jdoe'"},
{else = 1}
]
bad-if-without-else = [
{if = "sender = 'jdoe'", then = 1}
]
bad-multiple-else = [
{if = "sender = 'jdoe'", then = 1},
{else = 1},
{else = 2}
]

View File

@@ -1,19 +0,0 @@
[list]
local-domains = ["example.org", "example.net"]
spammer-domains = "thatdomain.net"
local-users = "file://{LIST1}"
power-users = ["file://{LIST1}", "file://{LIST2}"]
[remote."lmtp"]
address = 192.168.0.1
port = 25
protocol = "lmtp"
lookup = true
[remote."lmtp".auth]
username = "hello"
secret = "world"
[remote."lmtp".tls]
implicit = true
allow-invalid-certs = true

View File

@@ -1,63 +0,0 @@
[envelope]
rcpt-domain = "foo.example.org"
rcpt = "user@foo.example.org"
sender-domain = "foo.net"
sender = "bill@foo.net"
local-ip = "192.168.9.3"
remote-ip = "A:B:C::D:E"
mx = "mx.somedomain.com"
authenticated-as = "john@foobar.org"
priority = -4
listener = "smtp"
helo-domain = "hi-domain.net"
[eval."eq"]
test = [
{if = "sender = 'bill@foo.net'", then = "sender"},
{else = false}
]
expect = "bill@foo.net"
[eval."starts-with"]
test = [
{if = "starts_with(rcpt_domain, 'foo')", then = "'mx.' + rcpt_domain"},
{else = false}
]
expect = "mx.foo.example.org"
[eval."regex"]
test = [
{if = "matches('^([^.]+)@([^.]+)\.(.+)$', rcpt)", then = "$1 + '+' + $2 + '@' + $3"},
{else = false}
]
expect = "user+foo@example.org"
[eval."regex-full"]
test = [
{if = "matches('^([^.]+)@([^.]+)\.(.+)$', rcpt)", then = "rcpt"},
{else = false}
]
expect = "user@foo.example.org"
[eval."envelope-match"]
test = [
{if = "matches('^([^.]+)@(.+)$', authenticated_as)", then = "'rcpt ' + rcpt + ' listener ' + listener + ' ip ' + local_ip + ' priority ' + priority"},
{else = false}
]
expect = "rcpt user@foo.example.org listener smtp ip 192.168.9.3 priority -4"
[eval."static-match"]
test = [
{if = "matches('^([^.]+)@(.+)$', authenticated_as)", then = "'hello world'"},
{else = false}
]
expect = "hello world"
[eval."no-match"]
test = [
{if = "matches('^([^.]+)@([^.]+)\.(.+)$org', authenticated_as)", then = "'test'"},
{else = false}
]
expect = false

View File

@@ -1,34 +0,0 @@
[envelope]
rcpt-domain = "example.org"
rcpt = "user@example.org"
sender-domain = "foo.net"
sender = "bill@foo.net"
local-ip = "192.168.9.3"
remote-ip = "A:B:C::D:E"
mx = "mx.somedomain.com"
authenticated-as = "john@foobar.org"
priority = -4
listener = "smtp"
helo-domain = "hi-domain.net"
[rule]
"eq-true" = "rcpt_domain = 'example.org'"
"eq-false" = "rcpt_domain = 'example.com'"
"listener-eq-true" = "listener = 'smtp'"
"listener-eq-false" = "listener = 'smtps'"
"ip-eq-true" = "local_ip = '192.168.9.3'"
"ip-eq-false" = "remote_ip = 'A:B:C::D:E'"
"ne-true" = "!is_empty(authenticated_as)"
"ne-false" = "authenticated_as != 'john@foobar.org'"
"starts-with-true" = "starts_with(mx, 'mx.some')"
"starts-with-false" = "starts_with(mx, 'enchilada')"
"ends-with-true" = "ends_with(sender, '@foo.net')"
"ends-with-false" = "ends_with(sender, 'chimichanga')"
"regex-true" = "matches('^(.+)@(.+)$', sender)"
"regex-false" = "matches('/^\\S+@\\S+\\.\\S+$/', mx)"
"any-of-true" = "authenticated_as != 'john@foobar.org' | rcpt_domain = 'example.org' | starts_with(mx, 'mx.some')"
"any-of-false" = "authenticated_as = 'something else' | rcpt_domain = 'something else' | starts_with(mx, 'something else')"
"all-of-true" = "rcpt_domain = 'example.org' & listener = 'smtp' & starts_with(mx, 'mx.some')"
"all-of-false" = "rcpt_domain = 'example.org' & listener = 'smtp' & starts_with(mx, 'something else')"
"none-of-true" = "!(authenticated_as = 'something else' | rcpt_domain = 'something else' | starts_with(mx, 'something else'))"
"none-of-false" = "!(rcpt_domain = 'example.org' | listener = 'smtp' | starts_with(mx, 'mx.some'))"

View File

@@ -1,29 +0,0 @@
[rule]
"my-nested-rule" = { any-of = [
{if = "rcpt-domain", eq = "example.org"},
{if = "remote-ip", eq = "192.168.0.0/24"},
{all-of = [
{if = "rcpt", starts-with = "no-reply@"},
{if = "sender", ends-with = "@domain.org"},
{none-of = [
{if = "priority", eq = 1},
{if = "priority", ne = -2},
]}
]}
]}
[rule."simple"]
if = "listener"
eq = "smtp"
[rule."is-authenticated"]
if = "authenticated-as"
ne = ""
[[rule."expanded".all-of]]
if = "sender-domain"
starts-with = "example"
[[rule."expanded".all-of]]
if = "sender"
in-list = "test-list"

View File

@@ -1,53 +0,0 @@
[server]
hostname = "mx.example.org"
greeting = "Stalwart SMTP - hi there!"
[server.listener."smtp"]
bind = ["127.0.0.1:9925"]
protocol = "smtp"
tls.implicit = false
[server.listener."smtps"]
bind = ["127.0.0.1:9465", "127.0.0.1:9466"]
protocol = "smtp"
max-connections = 1024
tls.implicit = true
tls.ciphers = ["TLS13_CHACHA20_POLY1305_SHA256", "TLS13_AES_256_GCM_SHA384"]
socket.ttl = 4096
[server.listener."submission"]
greeting = "Stalwart SMTP submission at your service"
protocol = "smtp"
hostname = "submit.example.org"
bind = "127.0.0.1:9991"
#tls.sni = [{subject = "submit.example.org", certificate = "other"},
# {subject = "submission.example.org", certificate = "other"}]
socket.backlog = 2048
[server.tls]
enable = true
implicit = true
timeout = 300
certificate = "default"
#sni = [{subject = "other.domain.org", certificate = "default"}]
protocols = ["TLSv1.2", "TLSv1.3"]
ciphers = []
ignore_client_order = true
[server.socket]
reuse-addr = true
reuse-port = true
backlog = 1024
ttl = 3600
send-buffer-size = 65535
recv-buffer-size = 65535
linger = 1
tos = 1
[certificate."default"]
cert = "%{file:{CERT}}%"
private-key = "%{file:{PK}}%"
[certificate."other"]
cert = "%{file:{CERT}}%"
private-key = "%{file:{PK}}%"

View File

@@ -1,11 +0,0 @@
[[throttle]]
match = "remote_ip == '127.0.0.1'"
key = ["remote_ip", "authenticated_as"]
rate = "50/30s"
enable = true
[[throttle]]
key = "sender_domain"
rate = "50/30s"
enable = true

View File

@@ -1,71 +0,0 @@
[database]
enabled = true # ignore
ports = [ 8000, 8001, 8002 ] # ignore
data = [ ["delta", "phi"], [3.14] ]
temp_targets = { cpu = 79.5, case = 72.0 }
[servers]
"127.0.0.1" = "value" # ignore
"character encoding" = "value"
[servers.alpha]
ip = "10.0.0.1"
role = "frontend"
[servers.beta]
ip = "10.0.0.2"
role = "backend"
[[products]]
name = "Hammer"
sku = 738594937
[[products]] # empty table within the array
[[products]] # ignore
name = "Nail"
sku = 284758393 # ignore
color = "gray"
[strings."my \"string\" test"]
str1 = "I'm a string."
str2 = "You can \"quote\" me."
str3 = "Name\tTabs\nNew Line."
lines = '''
The first newline is
trimmed in raw strings.
All other whitespace
is preserved.
'''
[sets]
integer = { 1 }
integers = { 1, 2, 3 }
string = { "red" }
strings = { "red", "yellow", "green" }
[arrays]
integers = [ 1, 2, 3 ]
colors = [ "red", "yellow", "green" ]
nested_arrays_of_ints = [ [ 1, 2 ], [3, 4, 5] ]
nested_mixed_array = [ [ 1, 2 ], ["a", "b", "c"] ]
string_array = [ "all", 'strings', """are the same""", '''type''' ]
# Mixed-type arrays are allowed
numbers = [ 0.1, 0.2, 0.5, 1, 2, 5 ]
integers2 = [
1, 2, 3 # this is ok
]
integers3 = [
4,
# comment in the middle
5, # this is ok
]
contributors = [
"Foo Bar <foo@example.com>" ,
{ name = "Baz Qux", email = "bazqux@example.com", url = "https://example.com/bazqux" }
]
[env]
var1 = !CARGO_PKG_NAME
var2 = !CARGO_PKG_NAME #comment