From 1cc6a9c89ef58c88e41b7a038ce2c1b6ac22cff9 Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Tue, 23 Jun 2026 09:47:47 +0000 Subject: [PATCH] deploy(mailu): wire gateway IMAP to the loopback Dovecot path in setup.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setup.sh §9e set AGENTBBS_MAIL_IMAP_ADDR to the front's :993, which the front's auth proxy rejects for the master-user login (and would clobber the working loopback wiring on every self-update). Point it at 127.0.0.1:14143 + AGENTBBS_MAIL_IMAP_PLAINTEXT=1 instead, matching the override + docs. Co-Authored-By: Claude Opus 4.8 --- setup.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index be895d6..ea5847f 100755 --- a/setup.sh +++ b/setup.sh @@ -396,6 +396,13 @@ AGENTBBS_HTTP_ADDR=${HTTP_ADDR} # AGENTBBS_MAIL_API_TOKEN= # AGENTBBS_MAIL_QUOTA_BYTES=1073741824 # 1 GiB per mailbox # AGENTBBS_WEBMAIL_URL=https://${MAIL_DOMAIN} # Roundcube (defaults to mail host) +# The in-BBS mail reader opens mailboxes via a Dovecot master user, reaching +# Dovecot directly over loopback (plaintext, on-host) to bypass Mailu's front +# auth proxy. §9e sets these; the master pass is a secret (see docs/mail.md): +# AGENTBBS_MAIL_IMAP_ADDR=127.0.0.1:14143 +# AGENTBBS_MAIL_IMAP_PLAINTEXT=1 +# AGENTBBS_MAIL_MASTER_USER=gateway +# AGENTBBS_MAIL_MASTER_PASS= # AgentGit (git.profullstack.com): every verified member — free and paid alike — # is provisioned a Forgejo account when they confirm their email. The admin token @@ -1078,7 +1085,12 @@ if [ "$MAIL" = "1" ]; then # API token are secrets the operator sets; see docs/mail.md). upsert_env AGENTBBS_MAIL_DOMAIN "${MAIL_DOMAIN}" upsert_env AGENTBBS_MAIL_ADDR_DOMAIN "${DOMAIN}" - upsert_env AGENTBBS_MAIL_IMAP_ADDR "${MAIL_DOMAIN}:993" + # The gateway reads Dovecot DIRECTLY over loopback (docker-compose.override.yml + # publishes it on 127.0.0.1:14143), bypassing Mailu's front nginx auth proxy so + # the master-user login works. Plaintext is safe — it never leaves the host. + # See docs/mail.md ("Why the gateway talks to Dovecot directly"). + upsert_env AGENTBBS_MAIL_IMAP_ADDR "127.0.0.1:14143" + upsert_env AGENTBBS_MAIL_IMAP_PLAINTEXT "1" upsert_env AGENTBBS_MAIL_SMTP_ADDR "127.0.0.1:25" # Cert refresher: copy Caddy's mail cert into Mailu on renewal (like news/IRC).