antispam 0.1.7

Spam message filter engines

To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:


This library currently provides only very simple means to filter spam messages. It was broken out to a separate project so that it can be shared between different projects:

Example usage

ìmport antispam.antispam;
import : parseJsonString;
import std.algorithm.comparison : among;

void main()
	auto config = parseJsonString(
			{"filter": "bayes"},
			{"filter": "blacklist",
				"settings": {
					"ips": ["", ""]

	auto antispam = new AntispamState;

	AntispamMessage msg;
	msg.headers["Subject"] = "8uy CH34P V14GR4!!11";
	msg.message = cast(const(ubyte)[])"Just look here: http://bestdrugdealz.c0m";
	msg.peerAddress = ["123.52.433.1", "vps12315.some.provider.n3t"];

		(status) {
			if (status.among(SpamAction.revoke, SpamAction.block))
				throw new Exception("Your message has been rejected!");
			// otherwise store message...
		(async_status) {
			if (async_status.among!(SpamAction.revoke, SpamAction.block)) {
				// Flag or delete the stored message.

			// It could also theoretically happen here that async_status is amnesty
			// or pass, so that a message that was already rejected in the first
			// phase would be accepted in retrospective. You'll have to decides on
			// a per-application basis if it makes sense to support this case, or
			// if immediate rejections always have precedence.
  • Sönke Ludwig
0.1.7 2024-Mar-03
0.1.6 2021-Jul-07
0.1.5 2020-Jun-07
0.1.4 2018-Mar-09
0.1.3 2017-Aug-13
Show all 18 versions
Download Stats:
  • 14 downloads today

  • 132 downloads this week

  • 475 downloads this month

  • 8808 downloads total

Short URL: