Didn`t gave a lot of info on the subject.
Stalwart Spamhaus DNSBL tests never trigger
I am trying to troubleshoot an issue with the Spamhaus DNSBL integration in my Stalwart setup. So far, none of the Spamhaus test messages have ever triggered a DNSBL hit or been blocked, and I would like to get some input from the developers/community.
Setup
- Proxmox host
- Stalwart running in a Debian LXC
- LXC was installed using the Proxmox Community Scripts
- Inbound mail is delivered directly to Stalwart
- Outbound mail is sent through an external mail relay
- Stalwart’s spam-filter configuration is essentially untouched/default
- Stalwart uses my own Unbound instance as its DNS resolver
- Current v0.16.21
For testing I am using the official Spamhaus Blocklist Tester:
Relevant DNSBL configuration
The standard Stalwart DNSBL definitions are still enabled. In particular, the built-in Spamhaus IP DNSBL is present:
STWT_RBL_SPAMHAUS_IP
I also created a custom E-mail DNSBL rule to test Spamhaus DQS Zero Reputation Domain (ZRD):
DLNTN_DQS_SPAMHAUS_ZRD_FROM
with E-mail scope.
The intended zone was:
env_from.domain + '.mykey.zrd.dq.spamhaus.net'
The DNS query itself works correctly. For example:
dig A 'zrd-dqs.blt.spamhaus.net.mykey.zrd.dq.spamhaus.net' +noall +answer
returns:
zrd-dqs.blt.spamhaus.net.mykey.zrd.dq.spamhaus.net. 1 IN A 127.0.2.2
Fixed-zone test
To rule out the env_from.domain expression, I temporarily replaced the dynamic Zone expression with the exact, known-working hostname:
'zrd-dqs.blt.spamhaus.net.ttdiptb6suzzxcnfql3n2kata.zrd.dq.spamhaus.net'
This did not change the result.
The corresponding Spamhaus BLT test message was still accepted and no custom DNSBL tag appeared.
The message contains:
X-Spam-Result: SPF_ALLOW (-0.20),
ARC_NA (0.00),
DKIM2_NA (0.00),
DKIM_NA (0.00),
FROM_EQ_ENV_FROM (0.00),
FROM_HAS_DN (0.00),
MID_RHS_MATCH_ENV_FROMTLD (0.00),
MID_RHS_MATCH_FROMTLD (0.00),
RCPT_COUNT_ONE (0.00),
RCPT_DOMAIN_IN_BODY (0.00),
RCPT_IN_BODY (0.00),
SOURCE_ASN_54054 (0.00),
TO_DN_NONE (0.00),
TO_MATCH_ENVRCPT_ALL (0.00),
RCVD_COUNT_ZERO (0.10),
RCVD_NO_TLS_LAST (0.10),
DMARC_NA (1.00),
HELO_IPREV_MISMATCH (1.00)
There is no RBL_SPAMHAUS_* or RBL_SPAMHAUS_ZRD tag.
Additional observation
Stalwart’s journal does show multiple:
DNSBL query
events, so DNSBL processing is apparently taking place.
However, I have not been able to determine from the normal logs which DNSBL was queried or what DNS response Stalwart received.
What I am trying to understand
If I understand the default configuration correctly, I would expect at least one or two of the appropriate Spamhaus BLT tests to trigger with the standard, otherwise untouched Stalwart spam-filter configuration.
So far, every Spamhaus test mail has been accepted.
I have also tried troubleshooting this with ChatGPT and Claude, but neither was able to identify a configuration error.
I want to determining whether:
- my understanding of the default Stalwart Spamhaus/DNSBL behavior is correct;
- there is some additional configuration required for the built-in
STWT_RBL_SPAMHAUS_IP rule to actually produce a tag/reject;
- using a custom Unbound resolver introduces a relevant issue;
- there is a way to see the actual DNSBL query and response generated by Stalwart;
Any help from someone familiar with the current Stalwart spam-filter/DNSBL implementation would be greatly appreciated.