Api for seen state, perl preferred

2009-05-20 Thread LALOT Dominique
Hello,

I'm following a previous thread. I would like to be able to open a seen
skiplist database in order to verify if a particular user has red its mail.
If possible, a way to do that in PERL would be perfect.

Thanks in advance

Dom

-- 
Dominique LALOT
Ingénieur Systèmes et Réseaux
http://annuaire.univmed.fr/showuser.php?uid=lalot

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

Re: Api for seen state, perl preferred

2009-05-20 Thread Bron Gondwana
On Wed, May 20, 2009 at 08:36:47AM +0200, LALOT Dominique wrote:
 Hello,
 
 I'm following a previous thread. I would like to be able to open a seen
 skiplist database in order to verify if a particular user has red its mail.
 If possible, a way to do that in PERL would be perfect.
 
 Thanks in advance

That's, um, tricky actually.

You need to read the uniqueid of the mailbox from the cyrus.header file
first, then read the contents of the skiplist file.  The easiest way to
do that is `cyr_dbtool /path/to/seen/file.db skiplist get $uniqueid`,
which will give you the seen record.  You then need to parse that for
uniqueids - it's in the format:

range,range,range

where range is either a single integer or $low:$high where low and high
are both integers - in which case all the messages in that range
inclusive are seen.

There's some other stuff in that seen record as well.  Here we go:

[br...@imap3 hm]$ cat /mnt/meta8/slot308/store23/meta/b/user/brong/cyrus.header 
| grep user.brong
user.brong  6af857f64475158a

[br...@imap3 hm]$ /usr/cyrus/bin/cyr_dbtool -C /etc/imapd-slot308-master.conf 
/mnt/meta8/slot308/store23/conf/user/b/brong.seen skiplist get 6af857f64475158a
1 1242810803 386716 1242800567 1:386615

Looks like I've seen all my email!  Also notice 4 other
fields at the start:

version lastread lastuid lastchange seen_items

Here's a more interesting couple of folders to give you an idea
of what ranges look like:

798b2df94146a5fe1 1095746485 1526 1095740252 
1:559,561:772,774:920,922:1109,:1115,1117:1138,1140:1170,1172:1195,1197:1521
798b2df9415762611 1125837870 34307 1123831223 
1:28289,29118,30871,31887,31935,32058,32209:32210,32214:32219,3,32228

So - in summary.  It's not easy.  Some plumbing required...
(lastuid gives you \Recent as per the IMAP flag - anything
newer than that is recent!)

Bron.

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Api for seen state, perl preferred

2009-05-20 Thread Adam Tauno WIlliams
  I'm following a previous thread. I would like to be able to open a seen
  skiplist database in order to verify if a particular user has red its mail.
  If possible, a way to do that in PERL would be perfect.
  Thanks in advance
 That's, um, tricky actually.
 You need to read the uniqueid of the mailbox from the cyrus.header file
 first, then read the contents of the skiplist file.  The easiest way to
 do that is `cyr_dbtool /path/to/seen/file.db skiplist get $uniqueid`,
 which will give you the seen record.  You then need to parse that for
 uniqueids - it's in the format:
 range,range,range
 where range is either a single integer or $low:$high where low and high
 are both integers - in which case all the messages in that range
 inclusive are seen.
 There's some other stuff in that seen record as well.  Here we go:
 [br...@imap3 hm]$ cat 
 /mnt/meta8/slot308/store23/meta/b/user/brong/cyrus.header | grep user.brong
 user.brong  6af857f64475158a

Maybe I'm looking in the wrong place; but on my test server
(cyrus-imapd-2.3.11) my cyrus.header looks like -

estate1:/var/spool/imap/user/awilliam # cat cyrus.header 
Cyrus mailbox header
The best thing about this system was that it had lots of goals.
--Jim Morris on Andrew
46a0a0b041114dce
Junk $Label1 $Label2 $Label3 $Label4 $Label5 $MDNSent NotJunk
receipt-handled $has_cal 
awilliamlrswipcda   

Is 46a0a0b041114dce the id?

 [br...@imap3 hm]$ /usr/cyrus/bin/cyr_dbtool -C /etc/imapd-slot308-master.conf 
 /mnt/meta8/slot308/store23/conf/user/b/brong.seen skiplist get 
 6af857f64475158a
 1 1242810803 386716 1242800567 1:386615
 Looks like I've seen all my email!  Also notice 4 other
 fields at the start:
 version lastread lastuid lastchange seen_items

lastchange is an epoch time stamp?

I'm not clear on what lastuid is; looks like it is a message id?  What
operation sets/updates the lastuid value?  

 Here's a more interesting couple of folders to give you an idea
 of what ranges look like:
 798b2df94146a5fe1 1095746485 1526 1095740252 
 1:559,561:772,774:920,922:1109,:1115,1117:1138,1140:1170,1172:1195,1197:1521
 798b2df9415762611 1125837870 34307 1123831223 
 1:28289,29118,30871,31887,31935,32058,32209:32210,32214:32219,3,32228
 So - in summary.  It's not easy.  Some plumbing required...
 (lastuid gives you \Recent as per the IMAP flag - anything
 newer than that is recent!)

So any message with $id  $lastuid is recent.



Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Api for seen state, perl preferred

2009-05-20 Thread Bron Gondwana
On Wed, May 20, 2009 at 07:34:52AM -0400, Adam Tauno WIlliams wrote:
 Maybe I'm looking in the wrong place; but on my test server
 (cyrus-imapd-2.3.11) my cyrus.header looks like -
 
 estate1:/var/spool/imap/user/awilliam # cat cyrus.header 
 Cyrus mailbox header
 The best thing about this system was that it had lots of goals.
   --Jim Morris on Andrew
   46a0a0b041114dce
 Junk $Label1 $Label2 $Label3 $Label4 $Label5 $MDNSent NotJunk
 receipt-handled $has_cal 
 awilliam  lrswipcda   
 
 Is 46a0a0b041114dce the id?

Yeah, just means you have no quota root.  That's the ID.
 
  [br...@imap3 hm]$ /usr/cyrus/bin/cyr_dbtool -C 
  /etc/imapd-slot308-master.conf 
  /mnt/meta8/slot308/store23/conf/user/b/brong.seen skiplist get 
  6af857f64475158a
  1 1242810803 386716 1242800567 1:386615
  Looks like I've seen all my email!  Also notice 4 other
  fields at the start:
  version lastread lastuid lastchange seen_items
 
 lastchange is an epoch time stamp?

Yes.

 I'm not clear on what lastuid is; looks like it is a message id?  What
 operation sets/updates the lastuid value?  

It's a UID.

  Here's a more interesting couple of folders to give you an idea
  of what ranges look like:
  798b2df94146a5fe1 1095746485 1526 1095740252 
  1:559,561:772,774:920,922:1109,:1115,1117:1138,1140:1170,1172:1195,1197:1521
  798b2df9415762611 1125837870 34307 1123831223 
  1:28289,29118,30871,31887,31935,32058,32209:32210,32214:32219,3,32228
  So - in summary.  It's not easy.  Some plumbing required...
  (lastuid gives you \Recent as per the IMAP flag - anything
  newer than that is recent!)
 
 So any message with $id  $lastuid is recent.

$uid.  Please don't get confused between the two.  It's an
important distinction.  Everything is in UIDs internally.

Bron.

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Api for seen state, perl preferred

2009-05-20 Thread Dan White

LALOT Dominique wrote:

Hello,

I'm following a previous thread. I would like to be able to open a 
seen skiplist database in order to verify if a particular user has red 
its mail. If possible, a way to do that in PERL would be perfect.


Thanks in advance

Dom



Connecting via IMAP would be more portable. See 'imtestExample.pl' 
within Mail::IMAPClient for something to start with.


With that script, you would do, e.g.:

./imtestExample.pl -m DIGEST-MD5 -a cyrus -u dwh...@olp.net -w mysecret

where 'cyrus' is an admin, and 'dwh...@olp.net' is the user who's 
mailbox you want to examine. You'll need to add logic to the script to 
view seen state.


- Dan

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

RE: Cyrus + Sieve

2009-05-20 Thread Gottschalk, David
Anyone? I would greatly appreciate any assistance with this issue.

Thanks.

David Gottschalk 
UTS Email team
david.gottsch...@emory.edu


-Original Message-
From: info-cyrus-bounces+dgottsc=emory@lists.andrew.cmu.edu 
[mailto:info-cyrus-bounces+dgottsc=emory@lists.andrew.cmu.edu] On Behalf Of 
Gottschalk, David
Sent: Tuesday, May 19, 2009 4:17 PM
To: info-cyrus@lists.andrew.cmu.edu
Subject: Cyrus + Sieve

I'm in the process of getting sieve working on my Cyrus servers. I've got 
everything working except for the vacation portion of sieve. I'm not sure why 
this isn't working. I've searched the web like crazy, and found quite a few 
people that had this issue. I've tried their solutions, but no luck. All the 
other sieve options work fine, but the vacation app. Any ideas?

I'm running Cyrus version: 2.2.12-3 (I know it's old)

Thanks for any assistance, I'd greatly appreciate it.

David Gottschalk
UTS Email team
david.gottsch...@emory.edu



This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information.  If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Cyrus + Sieve

2009-05-20 Thread Blake Hudson
I'm not a sieve guru, but I might be able to point you in the right 
direction for troubleshooting... How are you making your sieve scripts 
(websieve, squirrelmail plugin, horde/IMP, etc)? Are you sure the 
forwarding and sieve reject options are working as expected to generate 
new messages? Do you have a duplicate delivery db in your cyrus meta 
data folder?


-Blake

 Original Message  
Subject: Re: Cyrus + Sieve
From: Gottschalk, David dgot...@emory.edu
To: info-cyrus@lists.andrew.cmu.edu info-cyrus@lists.andrew.cmu.edu
Date: Wednesday, May 20, 2009 3:04:44 PM
 Anyone? I would greatly appreciate any assistance with this issue.

 Thanks.

 David Gottschalk 
 UTS Email team
 david.gottsch...@emory.edu


 -Original Message-
 From: info-cyrus-bounces+dgottsc=emory@lists.andrew.cmu.edu 
 [mailto:info-cyrus-bounces+dgottsc=emory@lists.andrew.cmu.edu] On Behalf 
 Of Gottschalk, David
 Sent: Tuesday, May 19, 2009 4:17 PM
 To: info-cyrus@lists.andrew.cmu.edu
 Subject: Cyrus + Sieve

 I'm in the process of getting sieve working on my Cyrus servers. I've got 
 everything working except for the vacation portion of sieve. I'm not sure why 
 this isn't working. I've searched the web like crazy, and found quite a few 
 people that had this issue. I've tried their solutions, but no luck. All the 
 other sieve options work fine, but the vacation app. Any ideas?

 I'm running Cyrus version: 2.2.12-3 (I know it's old)

 Thanks for any assistance, I'd greatly appreciate it.

 David Gottschalk
 UTS Email team
 david.gottsch...@emory.edu



 This e-mail message (including any attachments) is for the sole use of
 the intended recipient(s) and may contain confidential and privileged
 information.  If the reader of this message is not the intended
 recipient, you are hereby notified that any dissemination, distribution
 or copying of this message (including any attachments) is strictly
 prohibited.

 If you have received this message in error, please contact
 the sender by reply e-mail message and destroy all copies of the
 original message (including attachments).
 
 Cyrus Home Page: http://cyrusimap.web.cmu.edu/
 Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
 List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
 
 Cyrus Home Page: http://cyrusimap.web.cmu.edu/
 Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
 List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
   


Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


RE: Cyrus + Sieve

2009-05-20 Thread Gottschalk, David
I'm using SmartSieve to create the scripts.

The forwarding and reject options are working as expected.

Do duplicate delivery dbs create issues?

David Gottschalk 
UTS Email team
david.gottsch...@emory.edu


-Original Message-
From: info-cyrus-bounces+dgottsc=emory@lists.andrew.cmu.edu 
[mailto:info-cyrus-bounces+dgottsc=emory@lists.andrew.cmu.edu] On Behalf Of 
Blake Hudson
Sent: Wednesday, May 20, 2009 4:15 PM
To: info-cyrus@lists.andrew.cmu.edu
Subject: Re: Cyrus + Sieve

I'm not a sieve guru, but I might be able to point you in the right 
direction for troubleshooting... How are you making your sieve scripts 
(websieve, squirrelmail plugin, horde/IMP, etc)? Are you sure the 
forwarding and sieve reject options are working as expected to generate 
new messages? Do you have a duplicate delivery db in your cyrus meta 
data folder?


-Blake

 Original Message  
Subject: Re: Cyrus + Sieve
From: Gottschalk, David dgot...@emory.edu
To: info-cyrus@lists.andrew.cmu.edu info-cyrus@lists.andrew.cmu.edu
Date: Wednesday, May 20, 2009 3:04:44 PM
 Anyone? I would greatly appreciate any assistance with this issue.

 Thanks.

 David Gottschalk 
 UTS Email team
 david.gottsch...@emory.edu


 -Original Message-
 From: info-cyrus-bounces+dgottsc=emory@lists.andrew.cmu.edu 
 [mailto:info-cyrus-bounces+dgottsc=emory@lists.andrew.cmu.edu] On Behalf 
 Of Gottschalk, David
 Sent: Tuesday, May 19, 2009 4:17 PM
 To: info-cyrus@lists.andrew.cmu.edu
 Subject: Cyrus + Sieve

 I'm in the process of getting sieve working on my Cyrus servers. I've got 
 everything working except for the vacation portion of sieve. I'm not sure why 
 this isn't working. I've searched the web like crazy, and found quite a few 
 people that had this issue. I've tried their solutions, but no luck. All the 
 other sieve options work fine, but the vacation app. Any ideas?

 I'm running Cyrus version: 2.2.12-3 (I know it's old)

 Thanks for any assistance, I'd greatly appreciate it.

 David Gottschalk
 UTS Email team
 david.gottsch...@emory.edu



 This e-mail message (including any attachments) is for the sole use of
 the intended recipient(s) and may contain confidential and privileged
 information.  If the reader of this message is not the intended
 recipient, you are hereby notified that any dissemination, distribution
 or copying of this message (including any attachments) is strictly
 prohibited.

 If you have received this message in error, please contact
 the sender by reply e-mail message and destroy all copies of the
 original message (including attachments).
 
 Cyrus Home Page: http://cyrusimap.web.cmu.edu/
 Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
 List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
 
 Cyrus Home Page: http://cyrusimap.web.cmu.edu/
 Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
 List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
   


Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Cyrus + Sieve

2009-05-20 Thread Mike Eggleston
On Wed, 20 May 2009, Gottschalk, David might have said:

 Anyone? I would greatly appreciate any assistance with this issue.
 
 Thanks.
 
 David Gottschalk 
 UTS Email team
 david.gottsch...@emory.edu
 
 
 -Original Message-
 From: info-cyrus-bounces+dgottsc=emory@lists.andrew.cmu.edu 
 [mailto:info-cyrus-bounces+dgottsc=emory@lists.andrew.cmu.edu] On Behalf 
 Of Gottschalk, David
 Sent: Tuesday, May 19, 2009 4:17 PM
 To: info-cyrus@lists.andrew.cmu.edu
 Subject: Cyrus + Sieve
 
 I'm in the process of getting sieve working on my Cyrus servers. I've got 
 everything working except for the vacation portion of sieve. I'm not sure why 
 this isn't working. I've searched the web like crazy, and found quite a few 
 people that had this issue. I've tried their solutions, but no luck. All the 
 other sieve options work fine, but the vacation app. Any ideas?
 
 I'm running Cyrus version: 2.2.12-3 (I know it's old)
 
 Thanks for any assistance, I'd greatly appreciate it.
 
 David Gottschalk
 UTS Email team
 david.gottsch...@emory.edu

I had an issue with the vacation portion of sieve. I posted my solution
some time back to this list. Maybe a search of previous messages will
help find you a solution?

Mike

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Cyrus + Sieve

2009-05-20 Thread Blake Hudson
The duplicate db is used in the vacation code of sieve to determine if a 
sender has previously received a vacation response. As I understand it 
(from reading the mailing list), older versions of Cyrus made the 
duplicate db optional and the vacation portion of sieve may not work as 
expected without it. So, ensure that you have it enabled.


I'm not familiar with SmartSieve, but perhaps you could provide an 
example script that it creates when you setup a vacation response - 
perhaps me or someone else here can debug it...


--Blake

 Original Message  
Subject: Re: Cyrus + Sieve
From: Gottschalk, David dgot...@emory.edu
To: Blake Hudson bl...@ispn.net, info-cyrus@lists.andrew.cmu.edu 
info-cyrus@lists.andrew.cmu.edu

Date: Wednesday, May 20, 2009 3:18:02 PM

I'm using SmartSieve to create the scripts.

The forwarding and reject options are working as expected.

Do duplicate delivery dbs create issues?

David Gottschalk 
UTS Email team

david.gottsch...@emory.edu


-Original Message-
From: info-cyrus-bounces+dgottsc=emory@lists.andrew.cmu.edu 
[mailto:info-cyrus-bounces+dgottsc=emory@lists.andrew.cmu.edu] On Behalf Of 
Blake Hudson
Sent: Wednesday, May 20, 2009 4:15 PM
To: info-cyrus@lists.andrew.cmu.edu
Subject: Re: Cyrus + Sieve

I'm not a sieve guru, but I might be able to point you in the right 
direction for troubleshooting... How are you making your sieve scripts 
(websieve, squirrelmail plugin, horde/IMP, etc)? Are you sure the 
forwarding and sieve reject options are working as expected to generate 
new messages? Do you have a duplicate delivery db in your cyrus meta 
data folder?



-Blake

 Original Message  
Subject: Re: Cyrus + Sieve
From: Gottschalk, David dgot...@emory.edu
To: info-cyrus@lists.andrew.cmu.edu info-cyrus@lists.andrew.cmu.edu
Date: Wednesday, May 20, 2009 3:04:44 PM
  

Anyone? I would greatly appreciate any assistance with this issue.

Thanks.

David Gottschalk 
UTS Email team

david.gottsch...@emory.edu


-Original Message-
From: info-cyrus-bounces+dgottsc=emory@lists.andrew.cmu.edu 
[mailto:info-cyrus-bounces+dgottsc=emory@lists.andrew.cmu.edu] On Behalf Of 
Gottschalk, David
Sent: Tuesday, May 19, 2009 4:17 PM
To: info-cyrus@lists.andrew.cmu.edu
Subject: Cyrus + Sieve

I'm in the process of getting sieve working on my Cyrus servers. I've got 
everything working except for the vacation portion of sieve. I'm not sure why 
this isn't working. I've searched the web like crazy, and found quite a few 
people that had this issue. I've tried their solutions, but no luck. All the 
other sieve options work fine, but the vacation app. Any ideas?

I'm running Cyrus version: 2.2.12-3 (I know it's old)

Thanks for any assistance, I'd greatly appreciate it.

David Gottschalk
UTS Email team
david.gottsch...@emory.edu



This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information.  If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
  




Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
  



Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html