From 0e2021f343e0196b8441655a996fa3046ac98358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=BCttler?= Date: Thu, 16 Apr 2026 10:08:05 +0200 Subject: [PATCH] Fix integration tests: allow plain-text auth in Stalwart dev config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stalwart 0.14 disables PLAIN/LOGIN on non-TLS ports by default: - [imap.auth] allow-plain-text = true → unblocks IMAP LOGIN - [session.auth] mechanisms + allow-plain-text → advertises PLAIN/LOGIN on SMTP Also fix test: SMTP authenticates as "alice" not "alice@localhost" (Stalwart SMTP auth accepts username without domain, unlike IMAP login) Co-Authored-By: Claude Sonnet 4.6 --- stalwart-dev/config.toml | 9 +++++++++ test/integration/imap_sync_test.dart | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/stalwart-dev/config.toml b/stalwart-dev/config.toml index 7dae4a8..4f27e00 100644 --- a/stalwart-dev/config.toml +++ b/stalwart-dev/config.toml @@ -61,3 +61,12 @@ email = ["bob@localhost"] [authentication.fallback-admin] user = "admin" secret = "admin" + +# Allow LOGIN/PLAIN on the clear-text dev ports (no TLS in local test env). +# By default Stalwart only advertises PLAIN/LOGIN when is_tls — override that. +[imap.auth] +allow-plain-text = true + +[session.auth] +mechanisms = "[plain, login, oauthbearer, xoauth2]" +allow-plain-text = true diff --git a/test/integration/imap_sync_test.dart b/test/integration/imap_sync_test.dart index 04a7d71..d9b8041 100644 --- a/test/integration/imap_sync_test.dart +++ b/test/integration/imap_sync_test.dart @@ -63,7 +63,7 @@ void main() { final smtpClient = SmtpClient('test'); await smtpClient.connectToServer(imapHost, smtpPort, isSecure: false); await smtpClient.ehlo(); - await smtpClient.authenticate('$userA@localhost', passA); + await smtpClient.authenticate(userA, passA); final builder = MessageBuilder() ..from = [MailAddress('Alice', '$userA@localhost')]