-
Notifications
You must be signed in to change notification settings - Fork 306
feat(dnsbl): Add per-response-code scoring with custom messages #813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
thisisjaymehta
wants to merge
7
commits into
foxcpp:master
Choose a base branch
from
thisisjaymehta:copilot/improve-dnsbl-response-handling
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat(dnsbl): Add per-response-code scoring with custom messages #813
thisisjaymehta
wants to merge
7
commits into
foxcpp:master
from
thisisjaymehta:copilot/improve-dnsbl-response-handling
+669
−43
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: thisisjaymehta <31812582+thisisjaymehta@users.noreply.github.com>
foxcpp
reviewed
Jan 10, 2026
foxcpp
reviewed
Jan 10, 2026
foxcpp
reviewed
Jan 10, 2026
foxcpp
reviewed
Jan 10, 2026
17 tasks
Co-authored-by: thisisjaymehta <31812582+thisisjaymehta@users.noreply.github.com>
Co-authored-by: thisisjaymehta <31812582+thisisjaymehta@users.noreply.github.com>
Co-authored-by: thisisjaymehta <31812582+thisisjaymehta@users.noreply.github.com>
…ove version annotation Co-authored-by: thisisjaymehta <31812582+thisisjaymehta@users.noreply.github.com>
Co-authored-by: thisisjaymehta <31812582+thisisjaymehta@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for per-response-code scoring in DNSBL checks, allowing administrators to assign different scores and custom rejection messages based on specific DNSBL return codes. This enables efficient use of combined DNSBLs like Spamhaus ZEN with granular control.
Problem
Combined DNSBLs like Spamhaus ZEN (
zen.spamhaus.org) return different response codes for different listing types:127.0.0.2,127.0.0.3127.0.0.4-127.0.0.7127.0.0.10,127.0.0.11Currently, Maddy:
127.0.0.1/24as a single "hit"Users who want different scores for different listing types must query separate lists (
sbl.spamhaus.org,xbl.spamhaus.org,pbl.spamhaus.org), resulting in 3 DNS queries instead of 1.Reference: https://docs.spamhaus.com/datasets/docs/source/40-real-world-usage/PublicMirrors/MTAs/020-Postfix. html
Solution
Add a new
responseconfiguration block that allows per-response-code scoring and custom messages:When multiple response codes are returned (e.g.,
127.0.0.2and127.0.0.11), their scores are summed (10 + 5 = 15 in this example).Changes
Data Structures
ResponseRulestruct withNetworks,Score, andMessagefieldsListstruct withResponseRules []ResponseRuleListedErrwithScoreandMessagefieldsCore Logic
checkIP()now matches response codes against rules and sums scorescheckLists()usesListedErr.Scorewhen set, falls back to legacyScoreAdjListedErr.Fields()uses custom message when availableConfiguration
parseResponseRule()to parse newresponseblocksreadListCfg()to handle response blocks viaAllowUnknown()Backwards Compatibility
responses+scoreconfiguration works unchangedResponseRulesis configuredBenefits
Testing