devel:blueprints:mailin
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| devel:blueprints:mailin [2009/01/30 09:19] – created morten | devel:blueprints:mailin [2009/02/02 12:08] (current) – add link to another blueprint morten | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| The University of Tromsø have already started writing a MailIn replacement in Python, and this is up and running at the University, but with only a single plugin. | The University of Tromsø have already started writing a MailIn replacement in Python, and this is up and running at the University, but with only a single plugin. | ||
| - | This blueprint specifies the design required to include such a software component in NAV. | + | This blueprint specifies the design required to include such a software component in NAV, and most of is derived from the [[http:// |
| + | ===== System overview ===== | ||
| + | |||
| + | * The core of MailIn will be a small plugin-invoking engine with a minimal API offered to its plugins. | ||
| + | * The MailIn program will be invoked by an MDA (Mail Delivery Agent), and must expect to be fed an email payload on //stdin//. | ||
| + | * The payload will be offered in turn to each registered plugin. | ||
| + | * Once a plugin accepts the payload, MailIn core will not offer it to any other plugin. | ||
| + | * MailIn core verifies that the plugin offers its own '' | ||
| + | * When the plugin offers its own authorize function, this is called. | ||
| + | * If authorized, MailIn core will ask the plugin to process the payload. | ||
| + | * The plugin will process the payload in whatever manner it sees fit, and using the '' | ||
| + | |||
| + | ==== Plugin API ==== | ||
| + | A MailIn plugin consists of a Python module, which should provide three functions: | ||
| + | |||
| + | ^ function | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | |||
| + | The plugin must expect the '' | ||
| + | |||
| + | ==== Loading plugins ==== | ||
| + | * MailIn core will load plugin modules according to its configuration file. | ||
| + | * All plugin modules must be listed in a specific configuration option, separated by spaces or colons. | ||
| + | * suffix wildcards should be allowed, such that specifying ''" | ||
| + | * A plugin module that fails to import into the Python interpreter shall be ignored by the core, and an exception logged (including a full traceback). | ||
| + | |||
| + | ==== Configuration ===== | ||
| + | Example configuration file: | ||
| + | < | ||
| + | [mailin] | ||
| + | # What plugins to load | ||
| + | plugins = nav.mailin.plugins.* | ||
| + | |||
| + | # Global authorization check (header regexp pattern) | ||
| + | # check to see that uit.no is in the Received headers | ||
| + | authorization = ^Received: | ||
| + | |||
| + | # Plugin specific options | ||
| + | [nav.mailin.plugins.whatsup] | ||
| + | plugin_specific_value=foo | ||
| + | </ | ||
| + | |||
| + | ===== API usage ===== | ||
| + | The following Python / NAV libraries should be used for various aspects of the program: | ||
| + | ^ api ^ for what ^ | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | |||
| + | As of this writing, there is no API to create custom event type and alert type hierarchies in the NAV database. | ||
devel/blueprints/mailin.1233307183.txt.gz · Last modified: by morten
