[PR #9] [MERGED] Expand allowedUsers email field to support comma-separated and domains #57

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

📋 Pull Request Information

Original PR: https://github.com/decke/smtprelay/pull/9
Author: @JonathonReinhart
Created: 2/13/2021
Status: Merged
Merged: 2/14/2021
Merged by: @decke

Base: masterHead: expanded-allowed-senders


📝 Commits (7)

  • 86c899c Expand allowedUsers email field to support comma-separated and domains
  • 05c9bfd Refactor AuthFetch() to return AuthUser struct
  • 4132854 Ignore empty addrs after splitting commas
  • 18f6726 Add tests for auth parseLine()
  • 0c25dab Update documentation in smtprelay.ini
  • cabf848 Fix bug where addrAllowed() was incorrectly case-sensitive
  • c980683 Update allowedUsers allowed domain format to require leading @

📊 Changes

5 files changed (+278 additions, -23 deletions)

View changed files

📝 auth.go (+42 -20)
auth_test.go (+89 -0)
📝 main.go (+45 -2)
main_test.go (+94 -0)
📝 smtprelay.ini (+8 -1)

📄 Description

This closes #8 and implements Option 1.

In addition to the unit tests, this has been tested in production with the following sample:

appsrv $2a$10$xxxxxxx app@example.com,appsrv.internal.example.com

Then I attempted to send mail (sendmail):

  • As root Linux user
    • sendmail -r app@example.com me@gmail.com ✔️
    • sendmail me@gmail.com (effective address: root@appsrv.internal.example.com) ✔️
    • sendmail -r not-app@example.com me@gmail.com (failed, as expected)
  • As jreinhart Linux user:
    • sendmail me@gmail.com (effective address: jreinhart@appsrv.internal.example.com) ✔️

🔄 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/decke/smtprelay/pull/9 **Author:** [@JonathonReinhart](https://github.com/JonathonReinhart) **Created:** 2/13/2021 **Status:** ✅ Merged **Merged:** 2/14/2021 **Merged by:** [@decke](https://github.com/decke) **Base:** `master` ← **Head:** `expanded-allowed-senders` --- ### 📝 Commits (7) - [`86c899c`](https://github.com/decke/smtprelay/commit/86c899c955fe2af3d85d5622e358321f28c0f8ae) Expand allowedUsers email field to support comma-separated and domains - [`05c9bfd`](https://github.com/decke/smtprelay/commit/05c9bfd556fcaac0c6d2d5cbde5876414cbf9962) Refactor AuthFetch() to return AuthUser struct - [`4132854`](https://github.com/decke/smtprelay/commit/41328549a89d34458be40803c6cfb405bd577fa8) Ignore empty addrs after splitting commas - [`18f6726`](https://github.com/decke/smtprelay/commit/18f672630d69e8b4d51716de84c4ed600cf8b5d2) Add tests for auth parseLine() - [`0c25dab`](https://github.com/decke/smtprelay/commit/0c25dabc3e284014e619baa64db2965b7af4854a) Update documentation in smtprelay.ini - [`cabf848`](https://github.com/decke/smtprelay/commit/cabf848f2dc633a5a380b95f1b1b1231a8af5886) Fix bug where addrAllowed() was incorrectly case-sensitive - [`c980683`](https://github.com/decke/smtprelay/commit/c9806831c774aef40a46ad3c5b0d8e400c0a02b7) Update allowedUsers allowed domain format to require leading @ ### 📊 Changes **5 files changed** (+278 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `auth.go` (+42 -20) ➕ `auth_test.go` (+89 -0) 📝 `main.go` (+45 -2) ➕ `main_test.go` (+94 -0) 📝 `smtprelay.ini` (+8 -1) </details> ### 📄 Description This closes #8 and implements Option 1. In addition to the unit tests, this has been tested in production with the following sample: ```ini appsrv $2a$10$xxxxxxx app@example.com,appsrv.internal.example.com ``` Then I attempted to send mail (`sendmail`): - As `root` Linux user - `sendmail -r app@example.com me@gmail.com` :heavy_check_mark: - `sendmail me@gmail.com` (effective address: `root@appsrv.internal.example.com`) :heavy_check_mark: - `sendmail -r not-app@example.com me@gmail.com` :x: (failed, as expected) - As `jreinhart` Linux user: - `sendmail me@gmail.com` (effective address: `jreinhart@appsrv.internal.example.com`) :heavy_check_mark: --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 18:33:11 +03:00
Sign in to join this conversation.
No labels
bug
pull-request
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/smtprelay#57
No description provided.