From e4ded88080a9091f891ebd51fce3800afc44c12d Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Fri, 27 Mar 2020 17:30:23 +0100 Subject: Script to output the internal Sieve format of RainLoop for a mailforward --- rainloop-fwd.php | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 rainloop-fwd.php (limited to 'rainloop-fwd.php') diff --git a/rainloop-fwd.php b/rainloop-fwd.php new file mode 100644 index 0000000..d742f44 --- /dev/null +++ b/rainloop-fwd.php @@ -0,0 +1,107 @@ +collectionToFileString($aFilters); + return $sUserFilter; + } +} + +# rainloop/v/1.12.1/app/libraries/RainLoop/Api.php +$oActions = \RainLoop\Actions::NewInstance(); +# me +$oSieveDump = new SieveDump($oActions->Plugins(), $oActions->Config()); + +# rainloop/v/1.12.1/app/libraries/RainLoop/Providers/Filters/Classes/Filter.php +$oFilter = new RainLoop\Providers\Filters\Classes\Filter(); + +# me +$sMailFwdTo = filter_var($_GET['to'], FILTER_SANITIZE_EMAIL); +$oFilter->FromJSON(array( + 'ID' => '1', + 'Name' => 'Renvoi', + 'ActionType' => \RainLoop\Providers\Filters\Enumerations\ActionType::FORWARD, + 'ActionValue' => $sMailFwdTo, + 'Keep' => 0, +)); + +header('Content-Type: text/plain'); +echo $oSieveDump->Dump(array($oFilter)); -- cgit v1.2.3