slimta.lookup

slimta.lookup.policy

Provides an implementation of the QueuePolicy interface that enforces policies specified in a slimta lookup record.

Currently the following record keys are implemented:

alias

Rewrites the envelope, replacing occurrences of the looked up address with the contents of this field.

add_headers

If the contents of this field are a JSON-decodable dictionary, the keys and values are prepended to the message as new headers. Existing headers are left untouched.

slimta.lookup.drivers

This package contains several implementations of the slimta lookup mechanism, which provides a simple interface to control actions and policies with external lookups. Under normal circumstances, slimta lookup drivers do not modify their backend data source.

slimta.lookup.drivers.redis

This module is available with the python-slimta[redis] package extra.

Implements slimta lookup against a redis data backend. By default, this driver expects records to be JSON-encoded string values. It can be configured to use the hash data structure instead, but it is less flexible.

slimta.lookup.drivers.dbapi2

Implements slimta lookup against a DB API 2.0 database interface. This driver should be flexible enough to support any implementing database.

Any database used with this driver should use gevent sockets (or monkey-patching) to ensure good performance.

This module also provides a SQLite convenience class.

slimta.lookup.drivers.dict

Implements slimta lookup against a standard Python dictionary-like object. This object should be given pre-populated in the constructor, or be a proxy to a persistent backend like shelve.

slimta.lookup.drivers.regex

Implements slimta lookup against a series of regular expressions.