Skip to content

Releases: Vnet-as/postfwd-anti-geoip-spam-plugin

v2.0.0 - IPv6 support

05 Oct 09:45
83106f4
Compare
Choose a tag to compare

Version 2.0.0 [3. October 2021]

Add IPv6 support for GeoIP2 databases.

This is a feature that was requested and meant to be included for a long time, but the revision of code was always postponed.

This release is tagged as 2.0.0 because IPv6 support in this plugin requires some breaking changes. The database must be dropped and recreated (or left to be created by plugin) because IPv6 addresses are longer than IPv4 addresses and the ip_address column had size of varchar(16). With this change the column will be expanded to 45 characters.

Note: Dropping the database is nothing major in this project as it only serves as cache. Altering the database schema or doing migrations would complicate the code.

There is one new dependency - Data::Validate::IP - that will make the IP address validation easier and more consistent than using regexes. It will test for valid IPv4 or IPv6 address, but also test if IP address is public. Since GeoIP databases can work only with public addresses, the GeoIP would throw error on other than public address anyway. This will reduce load on GeoIP.

If you forget to drop database, you will see error such as this in log:

[postfwd3/policy][10][LOG warning]: warning: DBD::mysql::st execute failed: Data too long for column 'ip_address' at row 1 at /etc/postfwd/postfwd-anti-spam.plugin line 411.?
postfwd::anti-spam-plugin ERROR[10]: Data too long for column 'ip_address' at row 1

Support for GeoIP database version 1 was dropped in this release. There are 4 reasons for this:

  1. There is no support for legacy GeoIP DBs.
  2. There are no official test databases.
  3. The support matrix became complicated.
  4. Legacy GeoIP database that was included in Docker image doesn't contain both IPv4 and IPv6 addresses and the interface would need to support loading of multiple files.

Breaking changes

  • Resized column ip_address in database schema from 16 to 45 characters.
  • Added new dependency Data::Validate::IP.
  • Support for GeoIP version 1 was dropped.

Features / Enhancements

  • IPv6 support
  • Better IP address validation

Bugfixes

None

v1.50.0 - GeoIP2 support

27 Mar 11:36
4bb1653
Compare
Choose a tag to compare

Version 1.50.0 [27. March 2021]

GeoIP2 Feature.

Breaking changes

  • New dependencies for GeoIP2 module were added, please see changes in cpanfile.

Features / Enhancements

  • Added GeoIP2 support. Now you can use Maxmind GeoIP2 databases. Path to GeoIP file can be changed in config app.geoip_db_path.
  • Removed entrypoint check for configuration file. The config file path can be overriden using environment variable POSTFWD_ANTISPAM_MAIN_CONFIG_PATH.
  • Added integration tests for GeoIP2 (test structure changed overall).

Version 1.40 - IP Whitelisting

03 Mar 12:42
72684f8
Compare
Choose a tag to compare

This stable release contains IP whitelisting feature (Reported as bug and requested by @csazku in #50) and one new CPAN dependency - Net::Subnet.

See Changelog and README for more information.

Version 1.30 - Postfwd3 support, Integration Testing

23 Mar 21:29
ae41641
Compare
Choose a tag to compare

Version 1.30 - Postfwd3 support, Integration Testing

This release uses new postfwd docker tag 2.00, which uses new postfwd3 script.

Postfwd3 changed plugin interface and therefore this release is not compatible with postfwd1 and postfwd2. If you want to use older postfwd versions, use tag v1.21.

Postfwd3 uses Alpine Linux for docker, so the dockerfile had to be rewritten.

To better work with GeoIP database, there is new configuration option geoip_db_path, which defaults to /usr/local/share/GeoIP/GeoIP.dat.

There is small change to logging, number of countries and unique IPs is logged on each request loop.

A lot of rework was done in tests directory. There is docker-compose with postgresql. Also shell script, which automatically runs docker-compose for both supported databases and does integration test with sample requests and verification through logs.

Plugin item now exports request{client_uniq_ip_login_count} and request{client_uniq_country_login_count} instead of result*.

Version 1.21 - DockerHub Readme

21 Mar 18:59
Compare
Choose a tag to compare

This release only fixes rendering of README in DockerHub.

Version 1.2 - Linting, testing improvements, bug fixes

11 Mar 21:44
Compare
Choose a tag to compare

This stable release has changes mainly in linting, readability and testability, but also contains several bugfixes.

Docker base image was updated from 1.37 to 1.39.

Added

  • Perl::Critic RC file .perlcriticrc for static code and linting purposes.
  • Install geoip-database into Docker image and added note in README.
  • Option to enable autoflush to STDOUT and log.
  • 10 second timeout and 3 retries to connect to database.
  • Testing script tests/dev-request.sh and instructions in README.

Changed

  • Updated postwfd Docker version to 1.39.
  • Perl Linting according to Perl Critic (#26)
  • Fixed Docker Compose volumes from type volume to bind.
  • Fix for double calling postfwd2 in Dockerfile.

Removed

  • Script lint.pl was removed and replaced by more general/portable file
    .perlcriticrc.

v1.1 Docker support

05 Jan 20:16
Compare
Choose a tag to compare

This stable version introduces docker image based on official postfwd docker image
and other minor changes.

All work was done by @Lirt ([email protected]),
docker review was done by @kirecek ([email protected]).

This plugin now uses versioning and releases, to keep track of stable versions and bring more reliability.

Full description of changes is located in CHANGELOG.md.

Changes:

  • Users are now able to run their local development environment using docker-compose template.
  • Ability to log into STDOUT.
  • Ability to change path to main configuration file, which was previously statically defined in /etc/postfix/anti-spam.conf. You can use following environment variables to change it:
    • POSTFWD_ANTISPAM_MAIN_CONFIG_PATH
    • POSTFWD_ANTISPAM_SQL_STATEMENTS_CONFIG_PATH
  • Script uses env perl shebang.
  • Change of logging format format to <DATE> <PROGRAM> <LOG_LEVEL> <MESSAGE>.
  • Connection to database is executed 3 times with 10 second timeout.
  • More verbose logging messages during database connection.

v1.0 First stable version

05 Jan 20:07
108ef05
Compare
Choose a tag to compare

First working stable solution of plugin.

Contains:

  • Postfwd plugin.
  • Sample configuration files.
  • Installation script.
  • README.md.