Solved Can you have Exim also check RBL's on smtp level?

Richard G

Verified User
Joined
Jul 6, 2008
Messages
14,989
Location
Maastricht
I was just wondering and did some Zenhaus tests and then I encountered this result:
This email was delivered, but it should have been rejected during the SMTP session. Your MX is not configured to use SMTP-level block listing for the block list for this test.

Seems this is normal with panels, because there is the same kind of quetsion on the CP forums (click).

This makes me wonder why an MTA should try to deliver mail that is on an RBL, or why it should and now I have 2 questions.

1.) Is it wise to reject during SMTP settings, so maybe blacklisted servers also do not get our mail addresses for example? Or is it better to not use SMTP level block listing and why not.

2.) If it's wise to do, how do we implement/activate this in Directadmin?
 
Yes, rejecting at SMTP time is generally preferable: you avoid accepting then bouncing, reduce backscatter, and stop the session before DATA. The trade-off is false positives, so use reputable DNSBLs, whitelist known senders, and never block authenticated/local traffic. In Exim, add a dnslists check in an ACL such as acl_smtp_rcpt, or earlier in acl_smtp_connect, with a clear deny message. For DirectAdmin, apply the ACL customization through its supported Exim override/local config mechanism if available; otherwise edit exim.conf carefully after backing it up. Validate with exim -bh and reload Exim. Avoid relying on one RBL without monitoring.
 
Exim blocking not good enough?

I have in /etc/exim.strings.conf.custom

RBL_DNS_LIST==b.barracudacentral.org : zen.spamhaus.org : bl.spamcop.net
 
Exim blocking not good enough?
Yes incoming, the question was at SMTP time so outgoing. ;)
I have a way more extended list in the exim.strings.conf.custom which works very well so that is not the problem.

I was wondering if it would be a good idea to stop messages on SMTP time as Spamhaus detected this was not the case. And looking at point 1 of my question, it might be a good idea to do that, also since Spamhaus thinks it's a good idea.

By the way... if you have a bit of mail going on, then you almost sure might run into the Spamhaus limits if you're using it like that. Check that in the logs.
You have to put your spamhaus key like this YOUR_DQS_KEY.zen.dq.spamhaus.net in that file if you have a DQS key. This was AI answer, so might also be the .org domein, I'm not sure, I've got it in Spamassassin at the moment.

Anyway, RBL's on SMTP, that is the question. ;)
 
The Spamhaus wording means rejection during the inbound SMTP transaction, not outbound mail. DirectAdmin's Exim config already supports this. Setting RBL_DNS_LIST only selects the DNSBL zones; it does not enable checking for domains.
Enable Admin Level -> Admin Settings -> Use RBL Blocking. DirectAdmin then uses /etc/virtual/use_rbl_domains; when enabled globally it links that file to the active domains list. The remote sender is rejected while its SMTP session is still open, before local delivery, so the test should then see SMTP-level blocking.
The caution is that DirectAdmin explicitly calls this aggressive. A DNSBL false positive becomes a hard rejection instead of only contributing to a spam score. Use only lists you trust and omit specific domains if needed. Authenticated submission on port 587 is a separate path from a remote inbound MX test.
DirectAdmin: enable realtime blocklists with Exim
 
Enable Admin Level -> Admin Settings -> Use RBL Blocking. DirectAdmin then uses /etc/virtual/use_rbl_domains;
I have this enabled on all servers already since our first server many years ago, but Spamhaus tests said it was not.

I've got a lot of tests stating this:
This email was delivered, but it should have been rejected during the SMTP session. Your MX is not configured to use SMTP-level block listing for the block list for this test.
Since I already have the inbound blocking enabled, I thought this was about outgoing blocklists.
But indeed MX is inbound.

So why are the Spamhaus test then saying it's not enabled?
We don't use the Exim.conf default but use this exim.strings.conf.custom file:
RBL_DNS_LIST==bl.spamcop.net : b.barracudacentral.org : rbl.interserver.net : bl.mailspike.net : psbl.surriel.com : all.spamrats.com
and the Exim log is full of mails blocked by these RBL's so I don't understand what Spamhaus is talking about then being it not enabled.
 
Ah lol never mind. Stupid me.:sleep: Probably was too tired and also stressed out abot the rspamd installation. :)

I think I understand why this is. It's testing only Spamhaus lists ofcourse and Idon't have the Spamhaus section directly in the RBL's at SMTP time but they are present in rSpamd so that's why it fails the SMTP level block ofcourse.
The other tests went fine.

Still remains the question if it's a smart idea or not to also scan against RBL lists for mails outgoing.
 
you don't need it until you working with security to prevent information expose to other country/organization.
Mostly these outbound like this should doing at the firewall layer.
 
Ah oke, I was thinking maybe it was wise to prevent that my customers would send mail to servers on spamlist exposing their mail addresses for example.
However it would create a higher workload because then RBL's must be checked in both directions. Maybe better not do it.
 
Back
Top