Previous: timsieved_fs, Up: Uploaders


4.3 Writing your own uploader

mailing-lists-sieve can be extended with new uploaders using the libtool dlpreopen mechanism. To add a new uploaded, create a file in src/uploaders.c exporting:

— Function: char** extensions ()

Used to initalize the module and returns a list of capabilities, that the generated scripts will use (the return value is currently ignored).

— Function: void install (char* address, char* data)

Installs a script for address with the supplied content/data and activates that script.

— Function: void delete (char* address)

Deletes a script proceeding the emails for address.

— Function: void close ()

Closes the connection and frees the allocated resources.

Each module can use static data, the functions are called sequentially.

See src/uploaders/timsieved_fs.c for a sample uploader. The libtool dlpreopen mechanism requires you to use _LTX_ in function names. Consider extending Makefile.am.