Skip to content

fix(email): skip SMTP AUTH when no username (local relay)#21

Merged
nechodom merged 1 commit into
mainfrom
fix/smtp-skip-auth-when-no-user
Jun 30, 2026
Merged

fix(email): skip SMTP AUTH when no username (local relay)#21
nechodom merged 1 commit into
mainfrom
fix/smtp-skip-auth-when-no-user

Conversation

@nechodom

Copy link
Copy Markdown
Owner

Follow-up to the localhost:25:25 fix. The test email now reaches localhost:25 but fails with No compatible authentication mechanism was foundsend_text always attaches SMTP credentials, so against a local postfix that accepts mail without auth (no AUTH mechanism advertised), lettre refuses to send.

Fix: only attach credentials when Username is set. Empty username ⇒ no AUTH (correct for an unauthenticated localhost relay); a configured provider relay (Postmark/Mailgun/…) authenticates as before.

After this + update.sh, your test to matej@nechodom.cz with empty user/pass against localhost:25 should send (postfix then handles outbound).

clippy -D warnings clean; adapters suite green.

🤖 Generated with Claude Code

…elay)

The test email failed with "No compatible authentication mechanism was found":
send_text always attached SMTP credentials, so against a local postfix on
localhost:25 that accepts mail WITHOUT auth (and advertises no AUTH mechanism)
lettre refused to send. Only attach credentials when smtp_user is non-empty;
an empty username now means "no AUTH", which is the right behavior for an
unauthenticated localhost relay. Authenticated provider relays (user set) are
unchanged.

clippy -D warnings clean; adapters suite green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nechodom nechodom merged commit 46602e2 into main Jun 30, 2026
1 check passed
@nechodom nechodom deleted the fix/smtp-skip-auth-when-no-user branch June 30, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant