Add option to change SPAM detection order

Use this forum if you want to suggest a new feature to hMailServer. Before posting, please search the forum to confirm that it has not already been suggested.
Post Reply

Do you need this feature?

No votes
Total votes: 1

Normal user
Normal user
Posts: 126
Joined: 2009-04-11 11:43

Add option to change SPAM detection order

Post by Keba » 2009-07-18 13:42

Currently the spam detection uses the following order (taken from ... der#p83467 )

* DNS blacklist
* HELO host
* MX records
* SpamAssassin

Personally I would rather have SPF, HELO/EHLO and MX record checks done before the DNS blacklist. If an email fails SPF, it is rejected out of hand on my settings and I wouldn't want to bother DNS/SURBL as a result. I use HELO/EHLO and MX as low scores so that if an email fails two DNS blacklist checks, it is then rejected.

Currently I am seeing a lot of emails rejected due to failing HELO, even though it is a score of 1, and the emails only fail because they are actually on two DNS blacklist. By changing the order, the reject message sent back to the spammer would be 'spamhaus' or similar, and much better than 'HELO didn't match IP'...

A number of these emails when manually checked later would also have failed the SPF record check.

I know I can mess around with the scores some more (make it so that two DNS blacklists creates a reject for example), but I really would rather check SPF first as bothering the DNSBL lists for every email puts an additional load on those services which in around 20% of the cases I've checked would have been unnecessary due to SPF records being present on those domains.

I was pleasantly surprised at how many domains now have SPF records to be honest - it appears SPF is being used more often which is good.

So, in summary, it would be nice to have the order configurable rather than hard coded. I can understand if the checks would need to be done in two different groups (pre data command, post data command), but configurable would be much better for advanced use if it was available...

Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Add option to change SPAM detection order

Post by ^DooM^ » 2009-07-18 14:07

I like the idea but i bet it would be a complete mare to code in.
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

Normal user
Normal user
Posts: 66
Joined: 2009-04-01 18:39
Location: NL

Re: Add option to change SPAM detection order

Post by mafr1 » 2009-07-18 14:07

I think SPF is done last of the pre-DATA checks because this check takes the longest and is the hardest to perform. If other checks fail before SPF then the mailserver doesn't need to check SPF.
E-mail is handled faster on heavily load servers. This could become an issue when changing the order.
hMailServer 5.3.1-B1748

Post Reply