Show HN: Locally maintainable postfix spam database
Today I was a little annoyed by spam that keeps plaguing my email servers, and I decided to make it a little more maintainable.<p>I remembered another HN thread where somebody uploaded a gist of spam domains [1] and decided to do something similar to avoid spam from large-scale spam providers like salesforce, AWS or digitalocean.<p>Currently, there&#x27;s no WHOIS integration yet, but I&#x27;m probably gonna work on this when I receive more spam.<p>Maybe someone here has a nice hosts block list and wants to contribute?<p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=32134734">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=32134734</a>
GitHub - cookiengineer/antispam: :construction: Spam Database and Classifiers for automated usage :construction:
antispam
This project is my attempt to fix the spam problem.
Currently this repository reflects the spam that I or my customers receive on a daily
basis, whereas it also includes providers that refuse to abide with the abuse report
policies because they have a conflict of interest to their paying customers (obviously).

Usage
The usage of this tool is intended to be used via cronjobs or via exec on event.
# View usage help
antispam;

# View an email and check for spam indicators
antispam view path/to/mail.eml;

# If an email is spam, return exit code 1
antispam classify path/to/mail.eml;

# Mark an email as spam, output new spammer ready for pull-request
antispam mark --json path/to/mail.eml;
Building
The build toolchain is implemented in go, so you only need to install go first.
# Install go compiler/framework
sudo pacman -S go;

# Build binary
cd /path/to/antispam/toolchain;
go run build.go;

# Execute binary
cd /path/to/antispam/build;
./antispam-linux-amd64;
Postfix Configuration
The Postfix configuration is documented in POSTFIX.md and uses
external postmap blocklists to block network prefixes and domains.
cd /path/to/antispam/toolchain;

# Upload and install postmap files
go run postfix.go install root@your.server.tld:2222;
Pull Requests
Pull Requests are certainly welcome! I don't like spam, and so do you, I guess?
So let's fight spam together!
If you want to contribute a new Spammer entry (generated via antispam mark --json <file>,
please make sure to use the same naming scheme for the files.
Each spammer organization has a separate JSON file, containing an Array of structs.Spammer.
For example, Amazon contains the structs.Spammer
instances for Amazon US, Amazon EU, Amazon JP etc.
License
AGPL-3
