Mail::MtPolicyd::Plugin::SqlUserConfig(3pm)

Mail::MtPolicyd::Plugin::SqlUserConfig3pm

Mtpolicyd plugin for retrieving the user config of a user

Version

version 2.05

Overview

This plugin will retrieve a JSON string from an SQL database and will merge the data structure into the current session.

This could be used to retrieve configuration values for users from a database.

Parameters

sql_query (default: SELECT config FROM user_config WHERE address=?)

The SQL query to retrieve the JSON configuration string.

The content of the first row/column is used.

field (default: recipient)

The request field used in the sql query to retrieve the user configuration.

Example user specific greylisting

Create the following table in the SQL database:

 CREATE TABLE `user_config` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `address` varchar(255) DEFAULT NULL,
   `config` TEXT NOT NULL,
   PRIMARY KEY (`id`),
   UNIQUE KEY `address` (`address`)
 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1
 INSERT INTO TABLE `user_config` VALUES( NULL, '[email protected]', '{"greylisting":"on"}' );

In mtpolicyd.conf:

  db_dsn="dbi:mysql:mail"
  db_user=mail
  db_password=password
  <Plugin user-config>
    module = "SqlUserConfig"
    sql_query = "SELECT config FROM user_config WHERE address=?"
  </Plugin>
  <Plugin greylist>
    enabled = "off" # off by default
    uc_enabled = "greylisting" # override with value of key 'greylisting' is set in session
    module = "Greylist"
    score = -5
    mode = "passive"
  </Plugin>

Releases

5 releases since Debian 9 (Stretch); the text changed 4 times.

  1. 9
  2. 10
  3. 11
  4. 12
  5. 13

Author

Markus Benning <[email protected]>

From mtpolicyd 2.05-1.2 in Debian 13 (Trixie). Parsed by carta from the page's man source.