Re: [SOGo] [DEV] SOGo Sieve Code

2011-12-01 Thread Francis Lachapelle

On 2011-12-01, at 11:15 AM, Ronald Yacketta wrote:

 Looks like I am missing the piece that takes a sieve file that looks like
 
 if header :contains From nag...@netcon.potsdam.edu
 {
 fileinto  nagios;
 }
 elseif header :contains List-Id Apcupsd Discussion List 
 apcupsd-users.lists.sourceforge.net
 {
 fileinto  apcupsd;
 }
 
 and converts into something SOGo likes {SOGoSieveFilters: [{active: 
 true, actions: [{method: fileinto, argument: foo}], rules: 
 [{operator: contains, field: subject, value: bar}], match: 
 any, name: foobar}]}''

Indeed, that's the purpose of your script!

:)

Francis

--
flachape...@inverse.ca :: +1.514.755.3640 :: http://www.inverse.ca
Inverse :: Leaders behind SOGo (http://sogo.nu) and PacketFence 
(http://packetfence.org)

-- 
users@sogo.nu
https://inverse.ca/sogo/lists

[SOGo] [DEV] SOGo Sieve Code

2011-12-01 Thread Ronald Yacketta
Hello all!

I am currently working on a perl Sieve parser / importer from SM / AvelSieve = 
SOGo. Currently have all the rules un base64'ed, de-serialized and in a flat 
file. Just need to see what format and how to get them into SOGo.

Thanks!!

-Ron-- 
users@sogo.nu
https://inverse.ca/sogo/lists

Re: [SOGo] [DEV] SOGo Sieve Code

2011-12-01 Thread Francis Lachapelle
Hi Ron

On 2011-12-01, at 9:09 AM, Ronald Yacketta wrote:

 I am currently working on a perl Sieve parser / importer from SM / AvelSieve 
 = SOGo. Currently have all the rules un base64'ed, de-serialized and in a 
 flat file. Just need to see what format and how to get them into SOGo.

Look at the users profile table (defined in SOGoProfileURL) or use sogo-tool to 
get/set Sieve-related parameters :

sogo-tool user-preferences get defaults username SOGoSieveFilters
sogo-tool user-preferences get defaults username Forward
sogo-tool user-preferences get defaults username Vacation

Setting the preferences is performed like this :

sogo-tool user-preferences set defaults username sieveadmin:password 
SOGoSieveFilters '{SOGoSieveFilters: [{active: true, actions: [{method: 
fileinto, argument: foo}], rules: [{operator: contains, field: 
subject, value: bar}], match: any, name: foobar}]}'

sogo-tool updates the SOGo database and puts the script on the Sieve server.


Francis

--
flachape...@inverse.ca :: +1.514.755.3640 :: http://www.inverse.ca
Inverse :: Leaders behind SOGo (http://sogo.nu) and PacketFence 
(http://packetfence.org)

-- 
users@sogo.nu
https://inverse.ca/sogo/lists

Re: [SOGo] [DEV] SOGo Sieve Code

2011-12-01 Thread Ronald Yacketta

On Dec 1, 2011, at 10:52 AM, Francis Lachapelle wrote:

 Hi Ron
 
 On 2011-12-01, at 9:09 AM, Ronald Yacketta wrote:
 
 I am currently working on a perl Sieve parser / importer from SM / AvelSieve 
 = SOGo. Currently have all the rules un base64'ed, de-serialized and in a 
 flat file. Just need to see what format and how to get them into SOGo.
 
 Look at the users profile table (defined in SOGoProfileURL) or use sogo-tool 
 to get/set Sieve-related parameters :
 
 sogo-tool user-preferences get defaults username SOGoSieveFilters
 sogo-tool user-preferences get defaults username Forward
 sogo-tool user-preferences get defaults username Vacation
 
 Setting the preferences is performed like this :
 
 sogo-tool user-preferences set defaults username sieveadmin:password 
 SOGoSieveFilters '{SOGoSieveFilters: [{active: true, actions: 
 [{method: fileinto, argument: foo}], rules: [{operator: 
 contains, field: subject, value: bar}], match: any, name: 
 foobar}]}'
 
 sogo-tool updates the SOGo database and puts the script on the Sieve server.
 
 
 Francis
 
 --
 flachape...@inverse.ca :: +1.514.755.3640 :: http://www.inverse.ca
 Inverse :: Leaders behind SOGo (http://sogo.nu) and PacketFence 
 (http://packetfence.org)
 
 -- 
 users@sogo.nu
 https://inverse.ca/sogo/lists

Francis,

Thanks! 

Looks like I am missing the piece that takes a sieve file that looks like

if header :contains From nag...@netcon.potsdam.edu
{
fileinto  nagios;
}
elseif header :contains List-Id Apcupsd Discussion List 
apcupsd-users.lists.sourceforge.net
{
fileinto  apcupsd;
}

and converts into something SOGo likes {SOGoSieveFilters: [{active: true, 
actions: [{method: fileinto, argument: foo}], rules: [{operator: 
contains, field: subject, value: bar}], match: any, name: 
foobar}]}''

-Ron

-- 
users@sogo.nu
https://inverse.ca/sogo/lists