I took the time to make some improvements to KTEmailPush KnowledgeTree Plugin. It’s now a real KT Plugin (instead of external script) with its own scheduler task. Version 1.0 publishes the plugin as a KT pluggable plugin, with its scheduler’s own task. Only configuration is still file-based only. It should be a matter of 4 or 5 steps to get it up and running in your system.
- Upload to specific folder, to user’s group/unit folder, to user’s Dropped Documents folder or you may use an external script to determine where the file should be uploaded to;
- Upload message body as document, optionally setting links between body and attachments;
- Restrict emails based on sender or recipient;
- Attachments can be uniquely distinguished, or be uploaded as new revisions of same document (based on filename);
- Multiple notifications can be sent: message without attachment detection (and removal), discarded non-existing KT user originated mail, sender notification of new documents (can be complemented with Workflow notifications for notifying recipients), notify sender of uploaded documents, notify system admininstration;
- Full debugging support and exclusive lock to avoid multiple runs;
The default behaviour is to upload to a specific folder, based on the address found in ‘From:’, which should be an unique email bound to an username.
It can be complemented with KT Workflows to fire notifications.
Also, there are lots of options (in config.inc.php) to decide what exactly the plugin should do with attachments, debugging, etc.
- You should create the following mail addresses to receive the documents, which should match $mail_username, $mail_cc and $mail_admin in config.inc.php: email@example.com, firstname.lastname@example.org, email@example.com;
- Unpack the source (or SVN checkout) to the directory ‘plugins’
svn checkout https://svn.forge.dri.pt/svn/kt-emailpush/trunk kt-emailpush
Note that kt_copy should maintain an endless growing copy of all email sent (which should be maintained by YOU, since it’s untouched), and that kt_admin is the admin’s destination address for notifications.
- Adjust the values in the config.inc.php script.
- Go to “Administration > Miscellaneous > Manage plugins” and reread plugins. The refreshed listing should now show “KT EmailPush Plugin”. Activate it and click on the “Update” button.
- Visit “Administration > Miscellaneous > Manage Task Scheduler” to ensure the “Fetch Mail” tasks is installed and active and it’s running with the desired frequency.
- Be sure to have your KT cron running.
The file specified in config $lockfile will prevent running concurrent copies. Eventually you can use this mutex facility to auto-unlock if you need to perform some kind of maintenance.
→ Find out more at KT’s Wiki: http://wiki.knowledgetree.com/Email_Gateway_Plugin.