From f01da9fc26e428a51e9fc76da7e02e33a17413e7 Mon Sep 17 00:00:00 2001 From: Jean-Yves <7360784+docjyJ@users.noreply.github.com> Date: Sun, 2 Jun 2024 21:47:07 +0200 Subject: [PATCH 1/6] Fix duplicate cert Signed-off-by: Jean-Yves <7360784+docjyJ@users.noreply.github.com> --- config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.toml b/config.toml index cc02e6a..5817c36 100644 --- a/config.toml +++ b/config.toml @@ -29,4 +29,4 @@ hostname = "mail.%{env:MAIL_DOMAIN}%" [certificate.nextcloud-aio] cert = "%{file:/opt/aio-certs/fullchain.crt}%" default = true -cert = "%{file:/opt/aio-certs/privkey.key}%" +private-key = "%{file:/opt/aio-certs/privkey.key}%" From 09d8bf25008432957f9c11697e0fe23f22214a9c Mon Sep 17 00:00:00 2001 From: Jean-Yves <7360784+docjyJ@users.noreply.github.com> Date: Sun, 2 Jun 2024 21:57:23 +0200 Subject: [PATCH 2/6] Update misig storrage Signed-off-by: Jean-Yves <7360784+docjyJ@users.noreply.github.com> --- config.toml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/config.toml b/config.toml index 5817c36..0e5b8b4 100644 --- a/config.toml +++ b/config.toml @@ -15,18 +15,33 @@ submissions.bind = "[::]:465" submissions.protocol = "smtp" submissions.tls.implicit = true -[tracer.stdout] -ansi = true -enable = true -level = "trace" +[storage] +data = "rocksdb" +fts = "rocksdb" +blob = "rocksdb" +lookup = "rocksdb" +directory = "internal" + +[store."rocksdb"] +type = "rocksdb" +path = "/opt/stalwart-mail/data" +compression = "lz4" + +[tracer."stdout"] type = "stdout" +level = "info" +ansi = false +enable = true [lookup.nextcloud-aio] domain = "%{env:MAIL_DOMAIN}%" hostname = "mail.%{env:MAIL_DOMAIN}%" - [certificate.nextcloud-aio] cert = "%{file:/opt/aio-certs/fullchain.crt}%" default = true private-key = "%{file:/opt/aio-certs/privkey.key}%" + +[authentication.fallback-admin] +user = "admin" +secret = "%{env:ADMIN_SECRET}%" From 99c095e4f91867ea1eccc94573b810a6fef8b879 Mon Sep 17 00:00:00 2001 From: Jean-Yves <7360784+docjyJ@users.noreply.github.com> Date: Sun, 2 Jun 2024 22:19:05 +0200 Subject: [PATCH 3/6] Update config.toml Signed-off-by: Jean-Yves <7360784+docjyJ@users.noreply.github.com> --- config.toml | 55 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/config.toml b/config.toml index 0e5b8b4..309ba76 100644 --- a/config.toml +++ b/config.toml @@ -1,19 +1,26 @@ -server.http.use-x-forwarded = true - -[server.listener] -https.bind = "[::]:10003" -https.protocol = "http" -https.tls.implicit = true -imaps.bind = "[::]:993" -imaps.protocol = "imap" -imaps.tls.implicit = true -sieve.bind = "[::]:4190" -sieve.protocol = "managesieve" -smtp.bind = "[::]:25" -smtp.protocol = "smtp" -submissions.bind = "[::]:465" -submissions.protocol = "smtp" -submissions.tls.implicit = true +# https://github.com/stalwartlabs/mail-server/blob/main/resources/config/config.toml + +[server.listener."smtp"] +bind = ["[::]:25"] +protocol = "smtp" + +[server.listener."submissions"] +bind = ["[::]:465"] +protocol = "smtp" +tls.implicit = true + +[server.listener."imaptls"] +bind = ["[::]:993"] +protocol = "imap" +tls.implicit = true + +[server.listener."sieve"] +bind = ["[::]:4190"] +protocol = "managesieve" + +[server.listener."caddy-aio"] +protocol = "http" +bind = ["[::]:10003"] [storage] data = "rocksdb" @@ -27,21 +34,25 @@ type = "rocksdb" path = "/opt/stalwart-mail/data" compression = "lz4" +[directory."internal"] +type = "internal" +store = "rocksdb" + [tracer."stdout"] type = "stdout" level = "info" ansi = false enable = true -[lookup.nextcloud-aio] -domain = "%{env:MAIL_DOMAIN}%" -hostname = "mail.%{env:MAIL_DOMAIN}%" +[lookup."nextcloud-aio"] +domain = "%{env:NC_DOMAIN}%" +hostname = "mail.%{env:NC_DOMAIN}%" [certificate.nextcloud-aio] cert = "%{file:/opt/aio-certs/fullchain.crt}%" default = true private-key = "%{file:/opt/aio-certs/privkey.key}%" -[authentication.fallback-admin] -user = "admin" -secret = "%{env:ADMIN_SECRET}%" +# [authentication.fallback-admin] +# user = "admin" +# secret = "%{env:ADMIN_SECRET}%" From 43f3a277a2f7cc9f2a0f341c0b31a0b73c19101e Mon Sep 17 00:00:00 2001 From: Jean-Yves <7360784+docjyJ@users.noreply.github.com> Date: Thu, 6 Jun 2024 17:22:45 +0200 Subject: [PATCH 4/6] Add admin default pass Signed-off-by: Jean-Yves <7360784+docjyJ@users.noreply.github.com> --- config.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config.toml b/config.toml index 309ba76..b3c0c23 100644 --- a/config.toml +++ b/config.toml @@ -53,6 +53,6 @@ cert = "%{file:/opt/aio-certs/fullchain.crt}%" default = true private-key = "%{file:/opt/aio-certs/privkey.key}%" -# [authentication.fallback-admin] -# user = "admin" -# secret = "%{env:ADMIN_SECRET}%" +[authentication.fallback-admin] +user = "admin" +secret = "%{env:ADMIN_SECRET}%" From 7f21323c79c52c587fa498bd33d3ce60afb4f1ee Mon Sep 17 00:00:00 2001 From: Jean-Yves <7360784+docjyJ@users.noreply.github.com> Date: Thu, 6 Jun 2024 17:36:16 +0200 Subject: [PATCH 5/6] Add log accessible in web admin Signed-off-by: Jean-Yves <7360784+docjyJ@users.noreply.github.com> --- config.toml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config.toml b/config.toml index b3c0c23..184c076 100644 --- a/config.toml +++ b/config.toml @@ -38,6 +38,15 @@ compression = "lz4" type = "internal" store = "rocksdb" +[tracer."log"] +type = "log" +level = "trace" +path = "/var/log" +prefix = "stalwart.log" +rotate = "daily" +ansi = false +enable = true + [tracer."stdout"] type = "stdout" level = "info" From a085c7ddd58d0e2e69305b85b76c7a5290792107 Mon Sep 17 00:00:00 2001 From: Jean-Yves <7360784+docjyJ@users.noreply.github.com> Date: Thu, 6 Jun 2024 17:42:54 +0200 Subject: [PATCH 6/6] Rename admin secret to STALWART_USER_PASS Signed-off-by: Jean-Yves <7360784+docjyJ@users.noreply.github.com> --- config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.toml b/config.toml index 184c076..fa40e6a 100644 --- a/config.toml +++ b/config.toml @@ -64,4 +64,4 @@ private-key = "%{file:/opt/aio-certs/privkey.key}%" [authentication.fallback-admin] user = "admin" -secret = "%{env:ADMIN_SECRET}%" +secret = "%{env:STALWART_USER_PASS}%"