EmailToWiki.pl is called from crontab and has one parameter specifying the name of a configuration file which should reside in the same directory as the script. The config file is eval'd and should set the following variables:
Event driven installation
The biggest problem with this extension is the inefficient polling of the POP box which makes it unresponsive and consumes unnecessary resources on a regular basis.
This could be configured in a more event-driven way by integrating with the exim4 router configuration. Specifically the queryprogram router would be used which executes a given script and passes the message to its STDIN pipe. The program should exit with 0 so that no errors are raised and send REDIRECT :blackhole: to STDOUT if the message matches any of its rules and is destined for the wiki, or PASS if not so it can be processed by the next router instead.
This would allow the mails to be checked as they come in and if destined for a wiki would be routed there straight away instead of going to the usual mail directory for storage.
The following router configuration section should be placed after the spam router in /var/www/exim4/exim4.conf.template because it exhibits a condition specifying to send only non-spams to the EmailToWiki.pl script which cuts down greatly on the processing required.
- Note: The condition needs to be modified to not process message with no recipient