Product SiteDocumentation Site

3.5. Python Dagent & Spooler hooks

The Zarafa Spooler and the Zarafa Dagent have been extened with a Python plugin framework. This framework makes it easier for advanced system administrators and developers to integrate systems with the spooler and dagent. System administrators and developers can easily add new functionality or change some behaviors of the existing system.
If the plugin framework in the spooler or dagent is enabled, it will search for python files in the directory plugin_path and look for a specific type of plugins. If the plugins are found in this directory, they will be verified and loaded. Every time the spooler or dagent is called it will execute the hooks based on priority. Plugins can validate and change a message on different stages of the spooler and dagent process. The Python plugin framework has an internal log system which forwards the log information to the Zarafa spooler and Zarafa dagent log.
To kickstart the usage of these hooks and expand functionality, Zarafa has included ready-for-use scripts.

Note

3.5.1. Dagent plugins

The Zarafa Delivery Agent plugin processflow overview
Figure 3.2. Zarafa Dagent Plugin hook locations

3.5.1.1. Move to public Dagent plugin

The move to public plugin moves incomming messages to a folder in the public.
Enable the move to public plugin, run the following command:
ln -s /usr/share/zarafa-dagent/python/plugins/movetopublic.py /var/lib/zarafa/dagent/plugins/movetopublic.py
For this plugin is a config file required. Make a copy of the configuration file with the following command:
cp /usr/share/zarafa-dagent/python/plugins/movetopublic.cfg /etc/zarafa/movetopublic.cfg

3.5.1.2. BMP2PNG converter Dagent plugin

The BMP2PNG plugin converts a BMP to PNG in the incoming email. This plugin can be used to reduce the image size of the delivered email. Enable the BMP2PNG plugin, run the following command:
ln -s /usr/share/zarafa-dagent/python/plugins/BMP2PNG.py /var/lib/zarafa/dagent/plugins/BMP2PNG.py

Note

The package python-imaging is required to use this plugin.

3.5.2. Spooler plugins

The spooler plugins make manipulation possible of the messages in MAPI format before conversions, however this does not include RTF formatted emails.
The Zarafa Spooler plugin processflow overview
Figure 3.3. Zarafa Spooler Pluginhook locations

3.5.2.1. Disclaimer Spooler plugin

The disclaimer plugin add a disclaimer to every email sent with the Zarafa spooler.
The disclaimer plugin supports plain text and HTML emails. RTF emails are not supported at the moment. To use the disclaimer plugin it’s necessary to create the directory /etc/zarafa/disclaimers which must include the disclaimers text files. The plugin is using the following files for the disclaimer:
Table 3.2. Table Disclaimer files
Filename Description
default.txt
The plain text version of the disclaimer
default.html
The HTML version of the disclaimer
<companyname>.txt
The plain text version of the disclaimer of a company when running in multi-tenancy mode
<companyname>.html
The HTML version of the disclaimer of a company when running in multi-tenancy mode

Important

All files must encoded in utf8
Enable the disclaimer plugin, run the following command:
ln -s /usr/share/zarafa-spooler/python/plugins/disclaimer.py /var/lib/zarafa/spooler/plugins/disclaimer.py