[PR #68] feat: Allow anonymous SMTP relays #68

Open
opened 2026-02-16 12:52:47 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/stoatchat/rust-authifier/pull/68
Author: @Assisting
Created: 2/15/2026
Status: 🔄 Open

Base: masterHead: conditional-lettre-credentials


📝 Commits (2)

  • 8112470 Add check for presence of real username and password before SMTP auth mechanism. Test account creation emails send with anonymous relay.
  • cadeda9 Remove unused iso8601 usings (didn't do a refactor in the end)

📊 Changes

2 files changed (+51 additions, -4 deletions)

View changed files

📝 crates/authifier/src/config/email_verification.rs (+7 -4)
📝 crates/rocket_authifier/src/routes/account/create_account.rs (+44 -0)

📄 Description

Fixes stoatchat/stoatchat#586

Local SMTP relays may not be set up to require authentication. This PR fixes a crash where an attempt to not supply a username/password in order to avoid authentication resulted in failures with Lettre; if either the username or password is absent, the call to .credentials is avoided, which should leave us with the default behaviour to use no authentication.

Rather than refactoring the SMTP settings to use Options, I tried to keep things tightly scoped and instead this code will check if a username and password are both present before falling back to trying an anonymous connection; this should result in meaningful error messages from the relay if it were to happen by accident.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/stoatchat/rust-authifier/pull/68 **Author:** [@Assisting](https://github.com/Assisting) **Created:** 2/15/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `conditional-lettre-credentials` --- ### 📝 Commits (2) - [`8112470`](https://github.com/stoatchat/rust-authifier/commit/811247016684b63d61c109c1751512619d21fb64) Add check for presence of real username and password before SMTP auth mechanism. Test account creation emails send with anonymous relay. - [`cadeda9`](https://github.com/stoatchat/rust-authifier/commit/cadeda9b84dc1fdcf70a7acb4047c1deed5cc18f) Remove unused iso8601 usings (didn't do a refactor in the end) ### 📊 Changes **2 files changed** (+51 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/authifier/src/config/email_verification.rs` (+7 -4) 📝 `crates/rocket_authifier/src/routes/account/create_account.rs` (+44 -0) </details> ### 📄 Description Fixes stoatchat/stoatchat#586 Local SMTP relays may not be set up to require authentication. This PR fixes a crash where an attempt to not supply a username/password in order to avoid authentication resulted in failures with Lettre; if either the username or password is absent, the call to `.credentials` is avoided, which should leave us with the [default behaviour](https://docs.rs/lettre/latest/lettre/transport/smtp/struct.SmtpTransport.html#method.builder_dangerous) to use no authentication. Rather than refactoring the SMTP settings to use `Option`s, I tried to keep things tightly scoped and instead this code will check if a username and password are both present before falling back to trying an anonymous connection; this should result in meaningful error messages from the relay if it were to happen by accident. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 12:52:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: stoatchat/rust-authifier#68