This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
devel:blueprints:mailin [2009/01/30 10:27] morten |
devel:blueprints:mailin [2009/01/30 10:43] morten |
||
---|---|---|---|
Line 21: | Line 21: | ||
==== Plugin API ==== | ==== Plugin API ==== | ||
- | * A MailIn plugin consists of a Python module, which must provide three functions: | + | A MailIn plugin consists of a Python module, which should provide three functions: |
- | - ''accept(payload)'' | + | |
- | - ''authorize(payload)'' | + | |
- | - ''process(payload)'' | + | |
+ | ^ function ^ required ^ description ^ | ||
+ | | ''accept(payload)'' | yes | Must return a true value if the payload can be processed by this plugin. | | ||
+ | | ''authorize(payload)'' | no | Must return a true value if the payload is authorized to generate an event, according to plugin-internal rules/configuration. If this function is not supplied by the plugin, the MailIn core must use a global authorize function to perform authorization according to globally configured rules. | | ||
+ | | ''process(payload)'' | yes | Process the payload, generate and post a single or multiple events. Return a true value if successful. | | ||
+ | |||
+ | The plugin must expect the ''payload'' object to be a message object from [[http://docs.python.org/library/email.html|Python's standard email library]]. |