mirror of
https://github.com/thisisjaymehta/maddy.git
synced 2026-04-08 21:07:58 +00:00
[PR #2] [CLOSED] [WIP] Refactor DNSBL response handling for detailed severity #3
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
thisisjaymehta/maddy#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/thisisjaymehta/maddy/pull/2
Author: @Copilot
Created: 1/10/2026
Status: ❌ Closed
Base:
master← Head:copilot/update-dnsbl-response-handling📝 Commits (1)
5091db7Initial plan📄 Description
Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.
Original prompt
Problem
Currently, Maddy's DNSBL implementation treats all response codes within a configured range equally. When using combined DNSBLs like Spamhaus ZEN (
zen.spamhaus.org), different return codes indicate different listing types with different severity:127.0.0.2,127.0.0.3→ SBL (known spam sources) - high severity127.0.0.4-127.0.0.7→ XBL (exploited/compromised hosts) - high severity127.0.0.10,127.0.0.11→ PBL (policy block, dynamic IPs) - lower severityCurrently, Maddy:
127.0.0.1/24as a single "hit"127.0.0.3,127.0.0.11,127.0.0.4), they all count as one hit with one scoreThis means 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
Proposed Solution
Add a new
responseconfiguration block that allows per-response-code scoring and custom messages:Implementation Details
1. Add new
ResponseRulestruct ininternal/check/dnsbl/dnsbl.go:2. Update
Liststruct to includeResponseRules:3. Update
ListedErrininternal/check/dnsbl/common.goto include score and message:4. Update
checkIPfunction ininternal/check/dnsbl/common.goto handle ResponseRules:ResponseRulesis configured, match each returned IP against rules and sum scoresResponsesis configured, use existing behavior for backwards compatibilitycheckIPWithRules(new) andcheckIPLegacy(existing behavior)5. Update
checkListsininternal/check/dnsbl/dnsbl.goto use score fromListedErr:ListedErr.Scorewhen set (new behavior)list.ScoreAdjfor backwards compatibility6. Update
readListCfgininternal/check/dnsbl/dnsbl.goto parse newresponseblocks:parseResponseRulefunction to handle the new syntax7. Update documentation in
docs/reference/checks/dnsbl.mdFiles to Modify
internal/check/dnsbl/dnsbl.go- Add ResponseRule struct, update List struct, update checkLists, update readListCfg, add parseResponseRuleinternal/check/dnsbl/common.go- Update ListedErr, update checkIP to handle ResponseRulesinternal/check/dnsbl/dnsbl_test.go- Add test cases for new functionalitydocs/reference/checks/dnsbl.md- Document the new response block syntaxBenefits
responses+scorestill works)Test Cases to Add
responseblocks → existing behavior preservedThis pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.