mirror of
https://github.com/stalwartlabs/mail-server.git
synced 2025-02-26 08:53:03 +08:00
40 lines
1.4 KiB
TOML
40 lines
1.4 KiB
TOML
#############################################
|
|
# SQL Directory configuration
|
|
#############################################
|
|
|
|
[directory."default"]
|
|
type = "sql"
|
|
address = "sqlite://%{BASE_PATH}%/data/accounts.sqlite3?mode=rwc"
|
|
|
|
[directory."default".options]
|
|
catch-all = true
|
|
#catch-all = { map = "(.+)@(.+)$", to = "info@${2}" }
|
|
subaddressing = true
|
|
#subaddressing = { map = "^([^.]+)\.([^.]+)@(.+)$", to = "${2}@${3}" }
|
|
superuser-group = "superusers"
|
|
|
|
[directory."default".pool]
|
|
max-connections = 10
|
|
min-connections = 0
|
|
#idle-timeout = "10m"
|
|
|
|
[directory."default".cache]
|
|
entries = 500
|
|
ttl = {positive = '1h', negative = '10m'}
|
|
|
|
[directory."default".query]
|
|
name = "SELECT name, type, secret, description, quota FROM accounts WHERE name = ? AND active = true"
|
|
members = "SELECT member_of FROM group_members WHERE name = ?"
|
|
recipients = "SELECT name FROM emails WHERE address = ?"
|
|
emails = "SELECT address FROM emails WHERE name = ? AND type != 'list' ORDER BY type DESC, address ASC"
|
|
verify = "SELECT address FROM emails WHERE address LIKE '%' || ? || '%' AND type = 'primary' ORDER BY address LIMIT 5"
|
|
expand = "SELECT p.address FROM emails AS p JOIN emails AS l ON p.name = l.name WHERE p.type = 'primary' AND l.address = ? AND l.type = 'list' ORDER BY p.address LIMIT 50"
|
|
domains = "SELECT 1 FROM emails WHERE address LIKE '%@' || ? LIMIT 1"
|
|
|
|
[directory."default".columns]
|
|
name = "name"
|
|
description = "description"
|
|
secret = "secret"
|
|
email = "address"
|
|
quota = "quota"
|
|
type = "type"
|