[PR #19] [MERGED] Move remaining config option parsing to ConfigLoad() #64

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

📋 Pull Request Information

Original PR: https://github.com/decke/smtprelay/pull/19
Author: @JonathonReinhart
Created: 3/14/2021
Status: Merged
Merged: 4/1/2021
Merged by: @decke

Base: masterHead: allow-any-sender-recipient


📝 Commits (5)

  • a896ab2 Move compilation of allowed_sender to ConfigLoad()
  • 7c0ba34 Move compilation of allowed_recipients to ConfigLoad()
  • 76ef135 Clarify allowed_sender/allowed_recipient empty string behavior
  • 22ef0c2 Move SMTP auth setup to ConfigLoad()
  • 3debf41 Adjust remote auth disabled check syntax

📊 Changes

3 files changed (+90 additions, -43 deletions)

View changed files

📝 config.go (+76 -3)
📝 main.go (+10 -38)
📝 smtprelay.ini (+4 -2)

📄 Description

Move remaining parsing of config options from server callbacks to ConfigLoad():

  • allowed_sender regex compilation
  • allowed_recipients regex compilation
  • SMTP auth setup and validation (remote_auth, remote_user, remote_password)

With this change, we can catch configuration errors during startup and avoid an error case during connection handling.

This also introduces a none type for remote_auth, and makes it the default. This is a more explicit equivalent of an empty username/password before this change.

This was identified during review of #13 and implementation of #15.


🔄 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/19 **Author:** [@JonathonReinhart](https://github.com/JonathonReinhart) **Created:** 3/14/2021 **Status:** ✅ Merged **Merged:** 4/1/2021 **Merged by:** [@decke](https://github.com/decke) **Base:** `master` ← **Head:** `allow-any-sender-recipient` --- ### 📝 Commits (5) - [`a896ab2`](https://github.com/decke/smtprelay/commit/a896ab284750e1ae4b86b83dd74afb293cd6a3b4) Move compilation of allowed_sender to ConfigLoad() - [`7c0ba34`](https://github.com/decke/smtprelay/commit/7c0ba340252b2e5777e9deb3fd78653b7b0a1442) Move compilation of allowed_recipients to ConfigLoad() - [`76ef135`](https://github.com/decke/smtprelay/commit/76ef135d33371a1ad594bccbea684699b3a782c6) Clarify allowed_sender/allowed_recipient empty string behavior - [`22ef0c2`](https://github.com/decke/smtprelay/commit/22ef0c2ee6261145176b964ffa38d70c5c1bcd02) Move SMTP auth setup to ConfigLoad() - [`3debf41`](https://github.com/decke/smtprelay/commit/3debf4127d364764789eae1bee9564080219a789) Adjust remote auth disabled check syntax ### 📊 Changes **3 files changed** (+90 additions, -43 deletions) <details> <summary>View changed files</summary> 📝 `config.go` (+76 -3) 📝 `main.go` (+10 -38) 📝 `smtprelay.ini` (+4 -2) </details> ### 📄 Description Move remaining parsing of config options from server callbacks to `ConfigLoad()`: - `allowed_sender` regex compilation - `allowed_recipients` regex compilation - SMTP auth setup and validation (`remote_auth`, `remote_user`, `remote_password`) With this change, we can catch configuration errors during startup and avoid an error case during connection handling. This also introduces a `none` type for `remote_auth`, and makes it the default. This is a more explicit equivalent of an empty username/password before this change. This was identified during review of #13 and implementation of #15. --- <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:13 +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#64
No description provided.