Mail::SpamAssassin::Contrib::Plugin::IPFilter - Blocks bad MTA behavior using IPTables.
version 1.2
To try this out, add this or uncomment this line in init.pre:
LoadPlugin Mail::SpamAssassin::Contrib::Plugin::IPFilter
Configuration defaults
iptables_support 6 iptables_bin $PATH/iptables ip6tables_bin $PATH/ip6tables filter_name spamipfilter db_type redis db_host 127.0.0.1 db_port 6387 db_user '' db_auth '' db_name spamipfilter trigger_score 6 trigger_messages 3 trigger_sensitivity 4 average_score_for_rule 7 expire_rule_seconds 172800 seconds_between_messages 30 seconds_to_decay_penalty 300 expires_multiplier_penalty 1.5 cache_decay_days 60 blacklist_score 30 common_hosts gmail.com, google.com, yahoo.com, hotmail.com, live.com admin_email '' admin_message Your message to $recipient from $email was blocked and your IP address $ip blacklisted due to excessive unsolicited bulk email. To reinstate your ability to send email to $recipient, please reply to $admin using a different off-network email, including the body of this message, with a request for reinstatement. log_dir /var/log verbose 0 lang en
Mail::SpamAssassin::Contrib::Plugin::IPFilter blacklists unsolicited bulk email senders using IPTables. It will blacklist the sender IP using the smallest network possible, up to /24, when UCE originates from multiple hosts on the same network. Depending on the diversity and frequency of spam received on a server, it may take a couple of days to become effective. Thereafter, the cache state will decay to prevent spammers from burning IP blocks.
Responsible, well-known email hosts (common_hosts) are given special treatment to avoid blacklisting their networks and the score is increased for external filtering of UCE originating from those hosts. The plugin may be configured to email the blacklisted sender a warning for remediation.
A crontab entry is created for maintenance. IPV6 support is experimental. Future versions may include a collaborative blacklist.
The following options may be used in site-wide (local.cf) configuration files to customize operation, and must be prefixed by ipfilter_:
Copyright © 2016 - Tamer Rizk, Inficron Inc.
This is free, open source software, licensed under the Revised BSD License. Please feel free to use and distribute it accordingly.
Tamer Rizk <foss@inficron.com>
This software is Copyright (c) 2016 by Tamer Rizk.
This is free software, licensed under:
The (three-clause) BSD License
To install Mail::SpamAssassin::Contrib::Plugin::IPFilter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mail::SpamAssassin::Contrib::Plugin::IPFilter
CPAN shell
perl -MCPAN -e shell install Mail::SpamAssassin::Contrib::Plugin::IPFilter
For more information on module installation, please visit the detailed CPAN module installation guide.