Skip to content

Instantly share code, notes, and snippets.

@johndoh
johndoh / jsevent.php
Created November 25, 2016 12:19
Example of how to control when the spam/ham buttons are shown from a MarkAsJunk2 driver.
<?php
/**
* MarkAsJunk2 JS events example
* This is an example of how to interact with the markasjunk2 JS event
* markasjunk2-update to change the spam/ham options shown for specific
* folders
*
* @version 0.1
* @author Philip Weir
@johndoh
johndoh / multi_driver.php
Last active January 1, 2016 16:49
Example of how to run multiple drivers with the MarkAsJunk2 plugin for Roundcube Webmail.Warning: This is only an example and not ready for use in production, the code needs to be modified and tested for specific implementations.
<?php
/**
* MarkAsJunk2 run multiple drivers
* WARNING: Use with extreme caution, running multiple drivers in succession is dangerous!
* Some drivers destroy the original message and create a new one, altering the message ID ($UID)
* and so multiple drivers must be run in a specific order. Extra step by step error checking may
* also be needed to prevent errors from cascading from one driver to another.
*
* In this example the edit_headers driver is used to add/remove a [SPAM] tag from the message