[dev] script for regenerate and activate all filters

Jason Keltz jas at cse.yorku.ca
Wed Apr 22 01:14:15 UTC 2015


Hi.

I hope I'm writing to the right list.    I'm switching our mail format 
from mbox to maildir, and I need to regenerate the Ingo procmail filters 
on my system.  I'm close coming up with a basic script to do this, but 
having some trouble, and hoping for some advice..

This part is fine..

#!/usr/bin/php
<?php

@define('HORDE_BASE', '/local/horde');

set_include_path(get_include_path() . PATH_SEPARATOR . HORDE_BASE . 
"/pear/php");

require_once HORDE_BASE . '/lib/Application.php';

Horde_Registry::appInit('ingo', array('cli' => true));

$user="jas";

   echo "$user";
   $registry->setAuth($user, array());
   $session->set('ingo', 'current_share', ':' . $user);
   $ingo_storage = $injector->getInstance('Ingo_Factory_Storage')->create();
print_r($ingo_storage->retrieve(Ingo_Storage::ACTION_WHITELIST)->getWhitelist());

   ^--- since this prints my whitelist, I know I'm close...

  I expected I'd be able to generate the script something like this:

   $ingo_script = 
$injector->getInstance('Ingo_Factory_Script')->createAll();
   $script = $ingo_script->generate();
  print_r($script);  <---- but this doesn't look like the procmail script...

And I know there's a command to activate the script afterwards.. what 
would that be?

   Ingo_Script_Util::activate($ingo_script->generate()); <--- something 
like that?

Thanks,

Jason.


More information about the dev mailing list