Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nigelhorne/cmilter
A mail filter to block emails from countries from which you don't wish to receive e-mails
https://github.com/nigelhorne/cmilter
milter perl perl5 sendmail spam spam-filtering
Last synced: 1 day ago
JSON representation
A mail filter to block emails from countries from which you don't wish to receive e-mails
- Host: GitHub
- URL: https://github.com/nigelhorne/cmilter
- Owner: nigelhorne
- Created: 2012-08-24T12:20:12.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2025-01-19T16:07:41.000Z (11 days ago)
- Last Synced: 2025-01-19T16:23:33.257Z (11 days ago)
- Topics: milter, perl, perl5, sendmail, spam, spam-filtering
- Language: Perl
- Homepage:
- Size: 39.1 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
cmilter
=======A mail milter to prevent e-mails from countries from which you don't wish to
receive e-mails.
It uses a combination of DNS resolution,
GeoIP databases,
and Whois lookups to determine the sender's country and applies a blacklist to block certain countries.Before installing:
* modify the blacklist hash table in the source code
* install dependenciesapt-get install libgeoip-dev
or
yum install perl-IPC-System-Simple perl-autodie perl-Data-Validate-IP
yum install perl-Geo-IP perl-Net-Whois-IP perl-CHI* choose your caching algorithm (look for $cache = in the source code)
* Install Sendmail::PMilter from CPAN, the other needed modules will be installed automaticallyTo install, simply put this script into /usr/local/etc/cmilter
Put this into /etc/mail/sendmail.mc:
INPUT_MAIL_FILTER(`cmilter', `S=local:/var/run/cmilter, F=T, T=S:4m;R:4m')dnl
And run
service sendmail restart
If you are using systemd, copy and paste this content into
/etc/systemd/system/cmilter.service[Unit]
Description=Block e-mail by country
After=network.target[Service]
ExecStart=/usr/local/etc/cmilter local:/var/run/cmilter
KillMode=process
Restart=on-failure[Install]
WantedBy=multi-user.targetThen run
systemctl daemon-reload
systemctl enable cmilter.service
systemctl start cmilter.serviceIf you are not using systemd, put these into /etc/rc.local:
rm -f /var/run/cmilter
/usr/local/etc/cmilter local:/var/run/cmilter