[PR #18] [MERGED] Allow any network and related enhancements #61

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

📋 Pull Request Information

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

Base: masterHead: allow-any-net


📝 Commits (4)

  • 4036213 Simplify peerIP determination in connectionChecker()
  • ef3f9c8 Move parsing of "allowed_nets" out to ConfigLoad()
  • 0503c12 Allow "allowed_nets" to be empty, meaning any network is allowed
  • 918df65 Require that networks in allowed_nets are networks and not hosts

📊 Changes

3 files changed (+38 additions, -14 deletions)

View changed files

📝 config.go (+29 -1)
📝 main.go (+7 -12)
📝 smtprelay.ini (+2 -1)

📄 Description

This PR allows the allowed_nets config option to be an empty string which means "any network", without having to enter 0.0.0.0/0 ::/0.

It also re-works the way allowed_nets is parsed to make several improvements:

  • Consecutive spaces are ignored
  • Errors from invalid CIDR notations are now caught
  • It is parsed at startup instead of at runtime.

This PR is a result of discussions on #13 and is inspired by grafana#4.

Follows #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/18 **Author:** [@JonathonReinhart](https://github.com/JonathonReinhart) **Created:** 3/13/2021 **Status:** ✅ Merged **Merged:** 3/14/2021 **Merged by:** [@JonathonReinhart](https://github.com/JonathonReinhart) **Base:** `master` ← **Head:** `allow-any-net` --- ### 📝 Commits (4) - [`4036213`](https://github.com/decke/smtprelay/commit/4036213dd5d39a10fbce8989ff307a12fbc40c31) Simplify peerIP determination in connectionChecker() - [`ef3f9c8`](https://github.com/decke/smtprelay/commit/ef3f9c8ea0eea57c5e36d91c482cf1da3bbab288) Move parsing of "allowed_nets" out to ConfigLoad() - [`0503c12`](https://github.com/decke/smtprelay/commit/0503c12ccd914fe6a518bdc235b06cbf5a434fcc) Allow "allowed_nets" to be empty, meaning any network is allowed - [`918df65`](https://github.com/decke/smtprelay/commit/918df65a3ad06ad7c50b95b69c7ecfe56c1b14fe) Require that networks in allowed_nets are networks and not hosts ### 📊 Changes **3 files changed** (+38 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `config.go` (+29 -1) 📝 `main.go` (+7 -12) 📝 `smtprelay.ini` (+2 -1) </details> ### 📄 Description This PR allows the `allowed_nets` config option to be an empty string which means "any network", without having to enter `0.0.0.0/0 ::/0`. It also re-works the way `allowed_nets` is parsed to make several improvements: - Consecutive spaces are ignored - Errors from invalid CIDR notations are now caught - It is parsed at startup instead of at runtime. This PR is a result of discussions on #13 and is inspired by grafana#4. Follows #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:12 +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#61
No description provided.