[PR #1204] [MERGED] feat: allow anonymous smtp authentication #1471

Closed
opened 2026-02-26 19:33:24 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/1204
Author: @Rainson12
Created: 6/28/2024
Status: Merged
Merged: 7/9/2024
Merged by: @Mythie

Base: mainHead: feat/add-smtp-without-authentication


📝 Commits (3)

  • c6067e4 feat: allow anonymous authentication
  • 0b4be62 Merge branch 'main' into feat/add-smtp-without-authentication
  • bb1e5e4 chore: update turbo config

📊 Changes

6 files changed (+19 additions, -8 deletions)

View changed files

📝 .env.example (+2 -0)
📝 docker/README.md (+1 -0)
📝 packages/email/mailer.ts (+7 -4)
📝 packages/lib/server-only/auth/send-confirmation-email.ts (+2 -2)
📝 packages/tsconfig/process-env.d.ts (+1 -0)
📝 turbo.json (+6 -2)

📄 Description

Description

This allows anonymous smtp authentication.
It also fixes a bug where STARTTLS would be used even though secure is set to false

https://github.com/documenso/documenso/issues/1167

Changes Made

  • only set auth options for smtp if username is set in environment variables (NEXT_PRIVATE_SMTP_USERNAME)
  • fixed typo in packages/lib/server-only/auth/send-confirmation-email.ts (adress -> address)

Testing Performed

Sent mails without smtp authentication. Comparable curl test would be:

curl --url 'smtp://MAILSERVER:25' --mail-from 'mail@domain.com'  --mail-rcpt 'receiver@domain.com'   -T <(echo -e 'From: mail@domain.com\nTo: receiver@domain.com\nSubject: Curl Test\n\nHello')

Checklist

  • I have tested these changes locally and they work as expected.
  • I have added/updated tests that prove the effectiveness of these changes.
  • I have updated the documentation to reflect these changes, if applicable.
  • I have followed the project's coding style guidelines.
  • I have addressed the code review feedback from the previous submission, if applicable.

Summary by CodeRabbit

  • New Features

    • Introduced a new environment variable NEXT_PRIVATE_SMTP_UNSAFE_IGNORE_TLS to optionally disable TLS for SMTP connections.
  • Bug Fixes

    • Corrected a typo from senderAdress to senderAddress in the email sender configuration.
  • Documentation

    • Updated docker/README.md to include details about the new environment variable NEXT_PRIVATE_SMTP_UNSAFE_IGNORE_TLS.
  • Refactor

    • Streamlined the turbo.json configuration for better readability and uniformity.
    • Simplified the SMTP configuration logic to conditionally include authentication details based on environment variables.

🔄 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/documenso/documenso/pull/1204 **Author:** [@Rainson12](https://github.com/Rainson12) **Created:** 6/28/2024 **Status:** ✅ Merged **Merged:** 7/9/2024 **Merged by:** [@Mythie](https://github.com/Mythie) **Base:** `main` ← **Head:** `feat/add-smtp-without-authentication` --- ### 📝 Commits (3) - [`c6067e4`](https://github.com/documenso/documenso/commit/c6067e404f540840958e3fcc87ac4232e330c532) feat: allow anonymous authentication - [`0b4be62`](https://github.com/documenso/documenso/commit/0b4be6286db8c2744d05495296940d294766b5af) Merge branch 'main' into feat/add-smtp-without-authentication - [`bb1e5e4`](https://github.com/documenso/documenso/commit/bb1e5e46678953628cb07cb5fc7808c3bfbdc314) chore: update turbo config ### 📊 Changes **6 files changed** (+19 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+2 -0) 📝 `docker/README.md` (+1 -0) 📝 `packages/email/mailer.ts` (+7 -4) 📝 `packages/lib/server-only/auth/send-confirmation-email.ts` (+2 -2) 📝 `packages/tsconfig/process-env.d.ts` (+1 -0) 📝 `turbo.json` (+6 -2) </details> ### 📄 Description ## Description This allows anonymous smtp authentication. It also fixes a bug where STARTTLS would be used even though `secure` is set to `false` ## Related Issue https://github.com/documenso/documenso/issues/1167 ## Changes Made - only set `auth` options for smtp if username is set in environment variables (`NEXT_PRIVATE_SMTP_USERNAME`) - fixed typo in `packages/lib/server-only/auth/send-confirmation-email.ts` (adress -> address) ## Testing Performed Sent mails without smtp authentication. Comparable curl test would be: ``` curl --url 'smtp://MAILSERVER:25' --mail-from 'mail@domain.com' --mail-rcpt 'receiver@domain.com' -T <(echo -e 'From: mail@domain.com\nTo: receiver@domain.com\nSubject: Curl Test\n\nHello') ``` ## Checklist <!--- Please check the boxes that apply to this pull request. --> <!--- You can add or remove items as needed. --> - [X] I have tested these changes locally and they work as expected. - [ ] I have added/updated tests that prove the effectiveness of these changes. - [X] I have updated the documentation to reflect these changes, if applicable. - [X] I have followed the project's coding style guidelines. - [ ] I have addressed the code review feedback from the previous submission, if applicable. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new environment variable `NEXT_PRIVATE_SMTP_UNSAFE_IGNORE_TLS` to optionally disable TLS for SMTP connections. - **Bug Fixes** - Corrected a typo from `senderAdress` to `senderAddress` in the email sender configuration. - **Documentation** - Updated `docker/README.md` to include details about the new environment variable `NEXT_PRIVATE_SMTP_UNSAFE_IGNORE_TLS`. - **Refactor** - Streamlined the `turbo.json` configuration for better readability and uniformity. - Simplified the SMTP configuration logic to conditionally include authentication details based on environment variables. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 19:33:24 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#1471
No description provided.