for use with postfix SMTP Access Policy Delegation.
Checks are implemented as plugins. Plugins can be configured and combined as needed. Plugins included:
It is also possible to implement your own plugins. Mtpolicyd is written in perl. See Mail::MtPolicyd::Cookbook::BasicModule on how to implement a basic plugin class.
Configuration is done via Apache-Style configuration file (Config::General):
user=mtpolicyd group=mtpolicyd pid_file="/var/run/mtpolicyd/mtpolicyd.pid" <VirtualHost 12345> name="reputation" <Plugin dnswl.org> module = "RBL" mode = "accept" domain="list.dnswl.org" </Plugin> <Plugin geoip> ...
You can use a single mtpolicyd instance to serve multiple configurations on different ports.
Mails can be tracked across different checks within a postfix session. Plugins can use the session for caching results(RBL lookups etc.). Sessions are stored in memcached.
Additional run-time configration parameters can be retrieved and stored within the session. The SqlUserConfig plugin will retrieve recipient, sender, client_address, sasl_username or other request specific settings from a database.
Checks can be combined into a scoring and mails can be rejected or taged later based on the score. You can also apply additional checks (eg. greylisting) based on the scoring. For example apply greylisting only to blacklisted IP and avoid the greylisting delay for regular mail.
mtpolicyd keeps track how many time each plugin runs. Plugins can also set their own timing events.