fix: remove dual-stack [::]:PORT bind to silence spurious EADDRINUSE errors

On Linux with IPv6 dual-stack (the Docker default), binding 0.0.0.0:PORT
already covers IPv6 via the dual-stack socket, so the subsequent [::]:PORT
bind hits EADDRINUSE on every Stalwart startup. Drop the sed substitution
that added the [::]:PORT entries.

Closes #478

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas SharedInbox
2026-06-06 21:51:17 +02:00
co-authored by Claude Sonnet 4.6
parent 913f9e8855
commit 9c6b037b21
+1 -1
View File
@@ -388,7 +388,7 @@ func (m *Ci) Stalwart() *dagger.Service {
return dag.Container().
From("stalwartlabs/stalwart:v0.14.1").
WithFile("/etc/stalwart/config.toml.orig", config).
WithExec([]string{"/bin/sh", "-c", "sed -e 's/hostname = \"localhost\"/hostname = \"stalwart\"/' -e 's/bind = \\[\"0.0.0.0:\\([0-9]*\\)\"\\]/bind = [\"0.0.0.0:\\1\", \"[::]:\\1\"]/g' /etc/stalwart/config.toml.orig > /etc/stalwart/config.toml"}).
WithExec([]string{"/bin/sh", "-c", "sed -e 's/hostname = \"localhost\"/hostname = \"stalwart\"/' /etc/stalwart/config.toml.orig > /etc/stalwart/config.toml"}).
WithDirectory("/tmp/stalwart", dataDir).
WithExposedPort(8080). // JMAP
WithExposedPort(1430). // IMAP