Installation binary first part.

This commit is contained in:
mdecimus
2023-07-09 11:06:37 +02:00
parent 705762c312
commit 843e61139a
27 changed files with 848 additions and 142 deletions

View File

@@ -1,10 +1,14 @@
#############################################
# Server configuration
#############################################
[server]
hostname = "__HOST__"
max-connections = 8192
[server.run-as]
user = "__RUN_AS_USER__"
group = "__RUN_AS_GROUP__"
user = "stalwart-mail"
group = "stalwart-mail"
[server.tls]
enable = true
@@ -49,5 +53,5 @@ rotate = "daily"
level = "info"
[certificate."default"]
cert = "file://__PATH__/etc/certs/tls.crt"
private-key = "file://__PATH__/etc/private/tls.key"
cert = "file://__CERT_PATH__"
private-key = "file://__PK_PATH__"

View File

@@ -1,13 +1,24 @@
#############################################
# Directory configuration
#############################################
[directory."sql"]
type = "sql"
address = "sqlite::memory:"
address = "sqlite://__PATH__/data/accounts.sqlite3?mode=rwc"
[directory."sql".options]
catch-all = true
subaddressing = true
superuser-group = "superusers"
[directory."sql".pool]
max-connections = 10
min-connections = 0
#idle-timeout = "10m"
[directory."sql".cache]
entries = 500
ttl = {positive = '1h', negative = '10m'}
[directory."sql".query]
name = "SELECT name, type, secret, description, quota FROM accounts WHERE name = ? AND active = true"
@@ -35,9 +46,21 @@ base-dn = "dc=example,dc=org"
dn = "cn=serviceuser,ou=svcaccts,dc=example,dc=org"
secret = "mysecret"
[directory."ldap".cache]
entries = 500
ttl = {positive = '1h', negative = '10m'}
[directory."ldap".options]
catch-all = true
subaddressing = true
superuser-group = "superusers"
[directory."ldap".pool]
max-connections = 10
min-connections = 0
max-lifetime = "30m"
idle-timeout = "10m"
connect-timeout = "30s"
[directory."ldap".filter]
name = "(&(|(objectClass=posixAccount)(objectClass=posixGroup))(uid=?))"
@@ -62,40 +85,52 @@ quota = "diskQuota"
[directory."imap"]
type = "imap"
address = "127.0.0.1"
port = 9198
port = 993
[directory."imap".pool]
max-connections = 5
max-connections = 10
min-connections = 0
max-lifetime = "30m"
idle-timeout = "10m"
connect-timeout = "30s"
[directory."imap".tls]
implicit = true
allow-invalid-certs = true
[directory."imap".lookup]
domains = ["example.org"]
[directory."imap".cache]
entries = 500
ttl = {positive = '1h', negative = '10m'}
[directory."smtp"]
[directory."imap".lookup]
domains = ["__DOMAIN__"]
[directory."lmtp"]
type = "lmtp"
address = "127.0.0.1"
port = 9199
port = 11200
[directory."smtp".limits]
[directory."lmtp".limits]
auth-errors = 3
rcpt = 5
[directory."smtp".pool]
max-connections = 5
[directory."lmtp".pool]
max-connections = 10
min-connections = 0
max-lifetime = "30m"
idle-timeout = "10m"
connect-timeout = "30s"
[directory."smtp".tls]
implicit = true
[directory."lmtp".tls]
implicit = false
allow-invalid-certs = true
[directory."smtp".cache]
[directory."lmtp".cache]
entries = 500
ttl = {positive = '10s', negative = '5s'}
ttl = {positive = '1h', negative = '10m'}
[directory."smtp".lookup]
domains = ["example.org"]
[directory."lmtp".lookup]
domains = ["__DOMAIN__"]
[directory."memory"]
type = "memory"
@@ -103,29 +138,30 @@ type = "memory"
[directory."memory".options]
catch-all = true
subaddressing = true
superuser-group = "superusers"
[[directory."memory".users]]
name = "admin"
description = "Superuser"
secret = "changeme"
email = ["admin@example.org"]
email = ["postmaster@__DOMAIN__"]
member-of = ["superusers"]
[[directory."memory".users]]
name = "jane"
description = "Jane Doe"
secret = "abcde"
email = ["jane@example.org", "jane.doe@example.org"]
email-list = ["info@example.org"]
email = ["jane@__DOMAIN__", "jane.doe@__DOMAIN__"]
email-list = ["info@__DOMAIN__"]
member-of = ["sales", "support"]
[[directory."memory".users]]
name = "bill"
description = "Bill Foobar"
secret = "$2y$05$bvIG6Nmid91Mu9RcmmWZfO5HJIMCT8riNW0hEp8f6/FuA2/mHZFpe"
quota = 500000
email = "bill@example.org"
email-list = ["info@example.org"]
quota = 50000000
email = ["bill@__DOMAIN__", "bill.foobar@__DOMAIN__"]
email-list = ["info@__DOMAIN__"]
[[directory."memory".groups]]
name = "sales"
@@ -136,4 +172,4 @@ name = "support"
description = "Support Team"
[directory."memory".lookup]
domains = ["example.org"]
domains = ["__DOMAIN__"]

View File

@@ -1,9 +1,13 @@
#############################################
# IMAP server configuration
#############################################
[server.listener."imap"]
bind = ["0.0.0.0:143"]
protocol = "imap"
[server.listener."imaptls"]
bind = ["0.0.0.0:9993"]
bind = ["0.0.0.0:993"]
protocol = "imap"
tls.implicit = true

View File

@@ -1,16 +1,27 @@
#############################################
# JMAP server configuration
#############################################
[server.listener."jmap"]
bind = ["0.0.0.0:__BIND_PORT__"]
url = "https://127.0.0.1:__BIND_PORT__"
bind = ["0.0.0.0:8080"]
url = "https://__HOST__:8080"
protocol = "jmap"
[store.db]
path = "__PATH__/db"
path = "__PATH__/data/index.sqlite3"
[store.db.pool]
max-connections = 10
#workers = 8
[store.db.cache]
size = 1000
[store.blob]
type = "local"
type = "__BLOB_STORE__"
[store.blob.local]
path = "__PATH__/blobs"
path = "__PATH__/data/blobs"
[store.blob.s3]
bucket = "stalwart"
@@ -23,7 +34,7 @@ secret-key = "minioadmin"
timeout = "30s"
[jmap]
directory = "sql"
directory = "__DIRECTORY__"
[jmap.session.cache]
ttl = "1h"
@@ -74,6 +85,9 @@ max-size = 75000000
[jmap.email.parse]
max-items = 10
[jmap.principal]
allow-lookups = true
[jmap.sieve]
disable-capabilities = []
notification-uris = ["mailto"]

View File

@@ -1,3 +1,7 @@
#############################################
# SMTP server configuration
#############################################
[server.listener."smtp"]
bind = ["0.0.0.0:25"]
greeting = "Stalwart SMTP at your service"
@@ -51,7 +55,7 @@ mt-priority = [ { if = "authenticated-as", ne = "", then = "mixer"},
[session.auth]
mechanisms = [ { if = "listener", ne = "smtp", then = ["plain", "login"]},
{ else = [] } ]
directory = [ { if = "listener", ne = "smtp", then = "local" },
directory = [ { if = "listener", ne = "smtp", then = "__SMTP_DIRECTORY__" },
{ else = false } ]
require = [ { if = "listener", ne = "smtp", then = true},
{ else = false } ]
@@ -68,7 +72,7 @@ wait = "5s"
relay = [ { if = "authenticated-as", ne = "", then = true },
{ else = false } ]
max-recipients = 25
directory = [ { if = "authenticated-as", ne = "", then = "local" },
directory = [ { if = "authenticated-as", ne = "", then = "__SMTP_DIRECTORY__" },
{ else = false } ]
[session.rcpt.cache]
@@ -157,7 +161,7 @@ expire = "5d"
[queue.outbound]
#hostname = "__HOST__"
next-hop = [ { if = "rcpt-domain", in-list = "local/domains", then = "lmtp" },
next-hop = [ { if = "rcpt-domain", in-list = "__SMTP_DIRECTORY__/domains", then = "__NEXT_HOP__" },
{ else = false } ]
ip-strategy = "ipv4-then-ipv6"
@@ -267,10 +271,10 @@ max-size = 26214400 # 25 mb
sign = ["rsa"]
[signature."rsa"]
#public-key = "file://__PATH__/etc/certs/dkim.crt"
private-key = "file://__PATH__/etc/private/dkim.key"
#public-key = "file://__PATH__/etc/dkim/__DOMAIN__.cert"
private-key = "file://__PATH__/etc/dkim/__DOMAIN__.key"
domain = "__DOMAIN__"
selector = "stalwart_smtp"
selector = "stalwart"
headers = ["From", "To", "Date", "Subject", "Message-ID"]
algorithm = "rsa-sha256"
canonicalization = "relaxed/relaxed"
@@ -282,8 +286,8 @@ set-body-length = false
report = true
[remote."lmtp"]
address = "__LMTP_HOST__"
port = __LMTP_PORT__
address = "127.0.0.1"
port = 11200
protocol = "lmtp"
concurrency = 10
timeout = "1m"
@@ -296,32 +300,13 @@ allow-invalid-certs = true
#username = ""
#secret = ""
[database."sql"]
#address = "sqlite://__PATH__/etc/sqlite.db?mode=rwc"
address = "postgres://postgres:password@localhost/test"
max-connections = 10
min-connections = 0
idle-timeout = "5m"
[database."sql".lookup]
auth = "SELECT secret FROM users WHERE email=?"
rcpt = "SELECT EXISTS(SELECT 1 FROM users WHERE email=? LIMIT 1)"
vrfy = "SELECT email FROM users WHERE email LIKE '%' || ? || '%' LIMIT 5"
expn = "SELECT member FROM mailing_lists WHERE id = ?"
domains = "SELECT EXISTS(SELECT 1 FROM domains WHERE name=? LIMIT 1)"
[database."sql".cache]
enable = ["rcpt", "domains"]
entries = 1000
ttl = {positive = "1d", negative = "1h"}
[sieve]
from-name = "Automated Message"
from-addr = "no-reply@__DOMAIN__"
return-path = ""
#hostname = "__HOST__"
sign = ["rsa"]
use-directory = "sql"
use-directory = "__SMTP_DIRECTORY__"
[sieve.limits]
redirects = 3
@@ -337,14 +322,14 @@ duplicate-expiry = "7d"
connect = '''
require ["variables", "extlists", "reject"];
if string :list "${env.remote_ip}" "local/blocked-ips" {
if string :list "${env.remote_ip}" "__SMTP_DIRECTORY__/blocked-ips" {
reject "Your IP '${env.remote_ip}' is not welcomed here.";
}
'''
ehlo = '''
require ["variables", "extlists", "reject"];
if string :list "${env.helo_domain}" "local/blocked-domains" {
if string :list "${env.helo_domain}" "__SMTP_DIRECTORY__/blocked-domains" {
reject "551 5.1.1 Your domain '${env.helo_domain}' has been blacklisted.";
}
'''
@@ -383,5 +368,4 @@ data = '''
'''
[management]
directory = "local"
directory = "__DIRECTORY__"