devel:blueprints:mailin
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| devel:blueprints:mailin [2009/01/30 09:53] – morten | devel:blueprints:mailin [2009/02/02 12:08] (current) – add link to another blueprint morten | ||
|---|---|---|---|
| Line 15: | Line 15: | ||
| * The payload will be offered in turn to each registered plugin. | * 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. | * Once a plugin accepts the payload, MailIn core will not offer it to any other plugin. | ||
| - | * MailIn core instructs | + | * MailIn core verifies that the plugin |
| - | * The plugin will process the payload in whatever manner it sees fit, and using the '' | + | * When the plugin offers its own authorize function, this is called. |
| + | | ||
| + | | ||
| + | ==== 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.1233309185.txt.gz · Last modified: by morten
