Mail::MtPolicyd::Plugin::SqlList(3pm) | User Contributed Perl Documentation | Mail::MtPolicyd::Plugin::SqlList(3pm) |
Mail::MtPolicyd::Plugin::SqlList - mtpolicyd plugin for accessing a SQL white/black/access list
version 2.05
<Plugin whitelist> module="SqlList" sql_query="SELECT client_ip FROM whitelist WHERE client_ip=?" match_action=dunno </Plugin> <Plugin blacklist> module="SqlList" sql_query="SELECT client_ip FROM blacklist WHERE client_ip=?" match_action="reject you are blacklisted!" </Plugin>
Plugin checks a field against a SQL table/query.
Depending on whether a supplied SQL query matched actions can be taken.
The module takes the following parameters:
? will be replaced by the IP address.
The module will match if the statement returns one or more rows.
By default the plugin will do nothing. One of the following actions should be specified:
You may use the following table for storing IPv4 addresses in MySQL:
CREATE TABLE `whitelist` ( `id` int(11) NOT NULL AUTO_INCREMENT, `client_ip` INT UNSIGNED NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `client_ip` (`client_ip`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO whitelist VALUES(NULL, INET_ATON('127.0.0.1'));
And use it as a whitelist in mtpolicyd:
<VirtualHost 12345> name="reputation" <Plugin whitelist> module="SqlList" sql_query="SELECT client_ip FROM whitelist WHERE client_ip=INET_ATON(?)" match_action="dunno" </Plugin> <Plugin trigger-greylisting> ... </VirtualHost>
Markus Benning <ich@markusbenning.de>
This software is Copyright (c) 2014 by Markus Benning <ich@markusbenning.de>.
This is free software, licensed under:
The GNU General Public License, Version 2, June 1991
2022-10-15 | perl v5.34.0 |