Re: Which imap command to rename a root mailbox while maintaining its partition

2019-03-18 Thread Thomas Cataldo
Well yes, the case you describe are working.

As a workaround we do :
A1 RENAME old1 new1
A2 RENAME new1 new1 our_partition

But this is bothering us as our software works as a cyrus replication
protocol endpoint and we don't want to receive :
APPLY RENAME (old1 new1 partition default)
as default is not a usual partition that our software can handle.



On Mon, Mar 18, 2019 at 9:31 AM Michael Menge <
michael.me...@zdv.uni-tuebingen.de> wrote:

> Hi,
>
> Quoting Sebastian Hagedorn :
>
> > Hi,
> >
> >> On cyrus 2.4.x we used to run
> >> A1 RENAME mbox1 mbox2 our_partition
> >>
> >> When we run that on cyrus 3.0.8 we get :
> >> A1 NO Cross-server or cross-partition move w/rename not supported
> >>
> >> Is there a way to do this rename with one command with cyrus3.
> >> If we run A1 RENAME mbox1 mbox2
> >> the mailbox is renamed as expected but it moves from our_partition to
> >> default which is not what we want.
> >>
> >> Any suggestion ?
> >
> > I have no idea, because we're not far enough along in our migration
> > to Cyrus 3, but this is troubling me. We currently use RENAME
> > specifically for moving users cross-partition. If that isn't
> > supported anymore, is there a new alternative in Cyrus 3?
>
>
> I have not tested this, but I think you can move cross-partition
> without rename
> and rename without move cross-partition.
>
> A1 RENAME mbox1 mbox1 our_partition
> A2 RENAME mbox1 mbox2
>
>
>  Michael Menge
>
>
>
> 
> M.MengeTel.: (49) 7071/29-70316
> Universität Tübingen   Fax.: (49) 7071/29-5912
> Zentrum für Datenverarbeitung  mail:
> michael.me...@zdv.uni-tuebingen.de
> Wächterstraße 76
> 72074 Tübingen
>
> 
> Cyrus Home Page: http://www.cyrusimap.org/
> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
> To Unsubscribe:
> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Which imap command to rename a root mailbox while maintaining its partition

2019-03-18 Thread Thomas Cataldo
Hi,

On cyrus 2.4.x we used to run
A1 RENAME mbox1 mbox2 our_partition

When we run that on cyrus 3.0.8 we get :
A1 NO Cross-server or cross-partition move w/rename not supported

Is there a way to do this rename with one command with cyrus3.
If we run A1 RENAME mbox1 mbox2
the mailbox is renamed as expected but it moves from our_partition to
default which is not what we want.

Any suggestion ?

Regards,
Thomas.

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: ACLs and cross-namespace move problem

2013-03-12 Thread Thomas Cataldo
On Mon, Mar 11, 2013 at 3:33 PM, Marc Patermann 
hans.mo...@ofd-z.niedersachsen.de wrote:

 Thomas,

 Thomas Cataldo schrieb (11.03.2013 10:21 Uhr):


 Note that some rights are available implicitly, for example 'anonymous'
 always has 'p' on user INBOXes, and users always have rights on mailboxes
 within their INBOX hierarchy.

 Do you have a link?


https://cyrusimap.org/docs/cyrus-imapd/2.4.17/overview.php#acladm



  I think Archive should qualify as user B always has rights on mailboxes
 within the INBOX hierarchy, like the Archive folder.
 When I look at the permissions with cyradm, I have :

 localhost lam user/b...@willow.vmw
 b...@willow.vmw lrswipkxtecda
 admin0 lrswipkxtecda
 a...@willow.vmw lrswipkxtecd

 localhost lam user/b/arch...@willow.vmw
 admin0 lrswipkxtecda
 a...@willow.vmw lrswipkxtecda


 Do I mis-understand something or should I file a bug ? (I am using unix
 hierarchy sep + altnamespace)

 I think this has always been this way.
 If you create a subfolder it inherits the rights from the upper level and
 so you have the same right for INBOX and subfolders, as long as you do not
 change the rights. You can always revoke your own rights, I think.
 Moving/renaming a folder has always (as far I remember for 2.2. und 2.3)
  been keeping the rights with the folder.


 Marc


The question is can we consider it a bug ? The same kind of problems
happens when an IMAP client deletes a folder inside a shared folder. It
renames the folder to move it to my trash and all the people that had read
permissions on the shared folder start seeing Other users/me/Trash/The
deleted folder in their imap clients.

Another related question would be, how do you guys deal with that ?

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

ACLs and cross-namespace move problem

2013-03-11 Thread Thomas Cataldo
Hi,

I have a problem with shared user mailboxes and permissions on cyrus 2.4.16.

User A has read/write access on user B (lrswipkxte)

Folders looks like this for user A:

   INBOX
   Archive
  2012
   Other Users/ == the user's namespace
B (user B inbox)
Sent
Drafts
Trash

User A wants to move the Archive folder to User B. He does a simple
dragdrop in thunderbird for his box to Other Users/B.

With its knowledge of permissions, thunderbird issues a RENAME :

RENAME Archive OtherUsers/B/Archive

Cyrus does not detect completely that the rename crosses a namespace
boundary. The Archive folder is at the right place on the filesystem :

/var/spool/cyrus/willow_vmw/domain/w/willow.vmw/b/user/b/Archive

But only A has permissions on it whereas the documentation states that:

Note that some rights are available implicitly, for example 'anonymous'
always has 'p' on user INBOXes, and users always have rights on mailboxes
within their INBOX hierarchy.

I think Archive should qualify as user B always has rights on mailboxes
within the INBOX hierarchy, like the Archive folder.
When I look at the permissions with cyradm, I have :

localhost lam user/b...@willow.vmw
b...@willow.vmw lrswipkxtecda
admin0 lrswipkxtecda
a...@willow.vmw lrswipkxtecd

localhost lam user/b/arch...@willow.vmw
admin0 lrswipkxtecda
a...@willow.vmw lrswipkxtecda


Do I mis-understand something or should I file a bug ? (I am using unix
hierarchy sep + altnamespace)

Regards,
Thomas.

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Problem with included global sieve script when mailbox contains a dot

2012-11-25 Thread Thomas Cataldo
Can anyone comment on that ?

We might be doing something wrong while settings our ACLs, but looking with
wireshark at how cyradm I think we're fine and that there's really a bug in
here.

Thomas,
Blue Mind.



On Mon, Nov 19, 2012 at 8:39 PM, Thomas Cataldo tcata...@gmail.com wrote:

 Hi,

 I did some more research on my problem and tracked the problem down to
 this test in append.c (cyrus 2.4) :

 else if (!strcmp(flag[i], \\flagged)) {
 if (as-myrights  ACL_WRITE) {  // this test fails when
 mailbox is a.b@domain
 message_index.system_flags |= FLAG_FLAGGED;
 }
 }

 My problem is probably related to unixhierarchysep settings and the way
 ACLs are set, but the following patch fixes it :

 diff --git a/imap/append.c b/imap/append.c
 index d3c2bd4..b622dd1 100644
 --- a/imap/append.c
 +++ b/imap/append.c
 @@ -160,12 +160,25 @@ int append_setup(struct appendstate *as, const char
 *name,
  {
  int r;
  struct quota q;
 +unsigned int pos;
 +size_t at_char;
 +char* fixed_acls;

  as-mailbox = NULL;
  r = mailbox_open_iwl(name, as-mailbox);
  if (r) return r;

 -as-myrights = cyrus_acl_myrights(auth_state, as-mailbox-acl);
 +fixed_acls = strdup(as-mailbox-acl);
 +syslog(LOG_ERR, before acls tweaks: %s\n, fixed_acls);
 +at_char = strcspn(fixed_acls, @);
 +for (pos=0; pos  at_char; pos++) {
 +  if (fixed_acls[pos] == '.') {
 +   fixed_acls[pos] = '^';
 +  }
 +}
 +syslog(LOG_ERR, after acls tweaks: %s\n, fixed_acls);
 +
 +as-myrights = cyrus_acl_myrights(auth_state, fixed_acls);

  if ((as-myrights  aclcheck) != aclcheck) {
 r = (as-myrights  ACL_LOOKUP) ?


 The two logs I added give the following output :

 Nov 19 20:37:00 ppday cyrus/lmtp[42207]: before acls tweaks: a...@buffy.vmw
 #011lrswipkxtecda#011admin0#011lrswipkxtecda#011ad...@buffy.vmw
 #011lrsp#011
 Nov 19 20:37:00 ppday cyrus/lmtp[42207]: after acls tweaks: a^b...@buffy.vmw
 #011lrswipkxtecda#011admin0#011lrswipkxtecda#011ad...@buffy.vmw
 #011lrsp#011

 I hope this test patch might help figure out what is wrong. My acls
 setup or a bug.

 Regards,
 Thomas Cataldo,
 Blue Mind.







 On Wed, Nov 14, 2012 at 10:40 AM, Thomas Cataldo tcata...@gmail.comwrote:

 Hello,

 Consider the following sieve setup :

 root@ppday:/var/spool/sieve# cat global/buffy.vmw.sieve.script
 require [body, copy, fileinto, imapflags ];

 # filters
 if allof ( address :contains from admin) {
 setflag \\Flagged;
 }

 # END

 root@ppday:/var/spool/sieve# cat
 domain/b/buffy.vmw/a/a^b/bm-user5.sieve.script
 require [body, copy, fileinto, imapflags, vacation, include ];

 include :global buffy.vmw.sieve;

 # END


 root@ppday:/var/spool/sieve# cat
 domain/b/buffy.vmw/s/sp/bm-user6.sieve.script
 require [body, copy, fileinto, imapflags, vacation, include ];

 include :global buffy.vmw.sieve;


 # END

 When ad...@buffy.vmw sends an email to a...@buffy.vmw and s...@buffy.vmw,
 the following happens :
  - the mail is correctly flagged for sp
  - no flagging for a.b

 Nothing interesting in my logs when the mail is delivered :


 Nov 14 10:17:20 ppday cyrus/master[19560]: about to exec
 /usr/lib/cyrus/bin/lmtpd
 Nov 14 10:17:20 ppday cyrus/lmtp[19560]: executed
 Nov 14 10:17:20 ppday cyrus/lmtp[19560]: skiplist: checkpointed
 /var/lib/cyrus/statuscache.db (0 records, 144 bytes) in 0 seconds
 Nov 14 10:17:21 ppday cyrus/lmtp[19560]: accepted connection
 Nov 14 10:17:21 ppday cyrus/lmtp[19560]: connection from ppday.buffy.vmw
 [172.16.78.128] preauth'd as postman
 Nov 14 10:17:21 ppday cyrus/lmtp[19560]: Delivered:
 1c42d02ef8953cb95219dafba...@buffy.vmw to mailbox:
 buffy.vmw!user.a^b
 Nov 14 10:17:21 ppday cyrus/lmtp[19560]: USAGE a^b user: 0.004000 sys:
 0.008000
 Nov 14 10:17:21 ppday cyrus/lmtp[19560]: Delivered:
 1c42d02ef8953cb95219dafba...@buffy.vmw to mailbox:
 buffy.vmw!user.admin
 Nov 14 10:17:21 ppday cyrus/lmtp[19560]: USAGE admin user: 0.00 sys:
 0.004000
 Nov 14 10:17:21 ppday cyrus/lmtp[19560]: Delivered:
 1c42d02ef8953cb95219dafba...@buffy.vmw to mailbox:
 buffy.vmw!user.sp
 Nov 14 10:17:21 ppday cyrus/lmtp[19560]: USAGE sp user: 0.00 sys:
 0.00
 Nov 14 10:17:21 ppday postfix/lmtp[19551]: 5DA0A21E37: to=a...@buffy.vmw,
 relay=172.16.78.128[172.16.78.128]:2400, delay=0.93,
 delays=0.07/0.03/0.03/0.79, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK)
 Nov 14 10:17:21 ppday postfix/lmtp[19551]: 5DA0A21E37: to=ad...@buffy.vmw,
 relay=172.16.78.128[172.16.78.128]:2400, delay=0.93,
 delays=0.07/0.03/0.03/0.79, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK)
 Nov 14 10:17:21 ppday postfix/lmtp[19551]: 5DA0A21E37: to=s...@buffy.vmw,
 relay=172.16.78.128[172.16.78.128]:2400, delay=0.93,
 delays=0.07/0.03/0.03/0.79, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK)
 Nov 14 10:17:21 ppday postfix/qmgr[20160]: 5DA0A21E37: removed

 Any know bugs with global sieve vs mailboxes with dot in them ?
 Can I enable more verbose

Re: Problem with included global sieve script when mailbox contains a dot

2012-11-19 Thread Thomas Cataldo
Hi,

I did some more research on my problem and tracked the problem down to this
test in append.c (cyrus 2.4) :

else if (!strcmp(flag[i], \\flagged)) {
if (as-myrights  ACL_WRITE) {  // this test fails when
mailbox is a.b@domain
message_index.system_flags |= FLAG_FLAGGED;
}
}

My problem is probably related to unixhierarchysep settings and the way
ACLs are set, but the following patch fixes it :

diff --git a/imap/append.c b/imap/append.c
index d3c2bd4..b622dd1 100644
--- a/imap/append.c
+++ b/imap/append.c
@@ -160,12 +160,25 @@ int append_setup(struct appendstate *as, const char
*name,
 {
 int r;
 struct quota q;
+unsigned int pos;
+size_t at_char;
+char* fixed_acls;

 as-mailbox = NULL;
 r = mailbox_open_iwl(name, as-mailbox);
 if (r) return r;

-as-myrights = cyrus_acl_myrights(auth_state, as-mailbox-acl);
+fixed_acls = strdup(as-mailbox-acl);
+syslog(LOG_ERR, before acls tweaks: %s\n, fixed_acls);
+at_char = strcspn(fixed_acls, @);
+for (pos=0; pos  at_char; pos++) {
+  if (fixed_acls[pos] == '.') {
+   fixed_acls[pos] = '^';
+  }
+}
+syslog(LOG_ERR, after acls tweaks: %s\n, fixed_acls);
+
+as-myrights = cyrus_acl_myrights(auth_state, fixed_acls);

 if ((as-myrights  aclcheck) != aclcheck) {
r = (as-myrights  ACL_LOOKUP) ?


The two logs I added give the following output :

Nov 19 20:37:00 ppday cyrus/lmtp[42207]: before acls tweaks: a...@buffy.vmw
#011lrswipkxtecda#011admin0#011lrswipkxtecda#011ad...@buffy.vmw#011lrsp#011
Nov 19 20:37:00 ppday cyrus/lmtp[42207]: after acls tweaks: a^b...@buffy.vmw
#011lrswipkxtecda#011admin0#011lrswipkxtecda#011ad...@buffy.vmw#011lrsp#011

I hope this test patch might help figure out what is wrong. My acls setup
or a bug.

Regards,
Thomas Cataldo,
Blue Mind.







On Wed, Nov 14, 2012 at 10:40 AM, Thomas Cataldo tcata...@gmail.com wrote:

 Hello,

 Consider the following sieve setup :

 root@ppday:/var/spool/sieve# cat global/buffy.vmw.sieve.script
 require [body, copy, fileinto, imapflags ];

 # filters
 if allof ( address :contains from admin) {
 setflag \\Flagged;
 }

 # END

 root@ppday:/var/spool/sieve# cat
 domain/b/buffy.vmw/a/a^b/bm-user5.sieve.script
 require [body, copy, fileinto, imapflags, vacation, include ];

 include :global buffy.vmw.sieve;

 # END


 root@ppday:/var/spool/sieve# cat
 domain/b/buffy.vmw/s/sp/bm-user6.sieve.script
 require [body, copy, fileinto, imapflags, vacation, include ];

 include :global buffy.vmw.sieve;


 # END

 When ad...@buffy.vmw sends an email to a...@buffy.vmw and s...@buffy.vmw,
 the following happens :
  - the mail is correctly flagged for sp
  - no flagging for a.b

 Nothing interesting in my logs when the mail is delivered :


 Nov 14 10:17:20 ppday cyrus/master[19560]: about to exec
 /usr/lib/cyrus/bin/lmtpd
 Nov 14 10:17:20 ppday cyrus/lmtp[19560]: executed
 Nov 14 10:17:20 ppday cyrus/lmtp[19560]: skiplist: checkpointed
 /var/lib/cyrus/statuscache.db (0 records, 144 bytes) in 0 seconds
 Nov 14 10:17:21 ppday cyrus/lmtp[19560]: accepted connection
 Nov 14 10:17:21 ppday cyrus/lmtp[19560]: connection from ppday.buffy.vmw
 [172.16.78.128] preauth'd as postman
 Nov 14 10:17:21 ppday cyrus/lmtp[19560]: Delivered:
 1c42d02ef8953cb95219dafba...@buffy.vmw to mailbox:
 buffy.vmw!user.a^b
 Nov 14 10:17:21 ppday cyrus/lmtp[19560]: USAGE a^b user: 0.004000 sys:
 0.008000
 Nov 14 10:17:21 ppday cyrus/lmtp[19560]: Delivered:
 1c42d02ef8953cb95219dafba...@buffy.vmw to mailbox:
 buffy.vmw!user.admin
 Nov 14 10:17:21 ppday cyrus/lmtp[19560]: USAGE admin user: 0.00 sys:
 0.004000
 Nov 14 10:17:21 ppday cyrus/lmtp[19560]: Delivered:
 1c42d02ef8953cb95219dafba...@buffy.vmw to mailbox: buffy.vmw!user.sp
 Nov 14 10:17:21 ppday cyrus/lmtp[19560]: USAGE sp user: 0.00 sys:
 0.00
 Nov 14 10:17:21 ppday postfix/lmtp[19551]: 5DA0A21E37: to=a...@buffy.vmw,
 relay=172.16.78.128[172.16.78.128]:2400, delay=0.93,
 delays=0.07/0.03/0.03/0.79, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK)
 Nov 14 10:17:21 ppday postfix/lmtp[19551]: 5DA0A21E37: to=ad...@buffy.vmw,
 relay=172.16.78.128[172.16.78.128]:2400, delay=0.93,
 delays=0.07/0.03/0.03/0.79, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK)
 Nov 14 10:17:21 ppday postfix/lmtp[19551]: 5DA0A21E37: to=s...@buffy.vmw,
 relay=172.16.78.128[172.16.78.128]:2400, delay=0.93,
 delays=0.07/0.03/0.03/0.79, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK)
 Nov 14 10:17:21 ppday postfix/qmgr[20160]: 5DA0A21E37: removed

 Any know bugs with global sieve vs mailboxes with dot in them ?
 Can I enable more verbose sieve execution logs ?


 Regards,
 Thomas Cataldo,
 Blue Mind



Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Problem with included global sieve script when mailbox contains a dot

2012-11-14 Thread Thomas Cataldo
Hello,

Consider the following sieve setup :

root@ppday:/var/spool/sieve# cat global/buffy.vmw.sieve.script
require [body, copy, fileinto, imapflags ];

# filters
if allof ( address :contains from admin) {
setflag \\Flagged;
}

# END

root@ppday:/var/spool/sieve# cat
domain/b/buffy.vmw/a/a^b/bm-user5.sieve.script
require [body, copy, fileinto, imapflags, vacation, include ];

include :global buffy.vmw.sieve;

# END


root@ppday:/var/spool/sieve# cat
domain/b/buffy.vmw/s/sp/bm-user6.sieve.script
require [body, copy, fileinto, imapflags, vacation, include ];

include :global buffy.vmw.sieve;


# END

When ad...@buffy.vmw sends an email to a...@buffy.vmw and s...@buffy.vmw, the
following happens :
 - the mail is correctly flagged for sp
 - no flagging for a.b

Nothing interesting in my logs when the mail is delivered :


Nov 14 10:17:20 ppday cyrus/master[19560]: about to exec
/usr/lib/cyrus/bin/lmtpd
Nov 14 10:17:20 ppday cyrus/lmtp[19560]: executed
Nov 14 10:17:20 ppday cyrus/lmtp[19560]: skiplist: checkpointed
/var/lib/cyrus/statuscache.db (0 records, 144 bytes) in 0 seconds
Nov 14 10:17:21 ppday cyrus/lmtp[19560]: accepted connection
Nov 14 10:17:21 ppday cyrus/lmtp[19560]: connection from ppday.buffy.vmw
[172.16.78.128] preauth'd as postman
Nov 14 10:17:21 ppday cyrus/lmtp[19560]: Delivered:
1c42d02ef8953cb95219dafba...@buffy.vmw to mailbox: buffy.vmw!user.a^b
Nov 14 10:17:21 ppday cyrus/lmtp[19560]: USAGE a^b user: 0.004000 sys:
0.008000
Nov 14 10:17:21 ppday cyrus/lmtp[19560]: Delivered:
1c42d02ef8953cb95219dafba...@buffy.vmw to mailbox:
buffy.vmw!user.admin
Nov 14 10:17:21 ppday cyrus/lmtp[19560]: USAGE admin user: 0.00 sys:
0.004000
Nov 14 10:17:21 ppday cyrus/lmtp[19560]: Delivered:
1c42d02ef8953cb95219dafba...@buffy.vmw to mailbox: buffy.vmw!user.sp
Nov 14 10:17:21 ppday cyrus/lmtp[19560]: USAGE sp user: 0.00 sys:
0.00
Nov 14 10:17:21 ppday postfix/lmtp[19551]: 5DA0A21E37: to=a...@buffy.vmw,
relay=172.16.78.128[172.16.78.128]:2400, delay=0.93,
delays=0.07/0.03/0.03/0.79, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK)
Nov 14 10:17:21 ppday postfix/lmtp[19551]: 5DA0A21E37: to=ad...@buffy.vmw,
relay=172.16.78.128[172.16.78.128]:2400, delay=0.93,
delays=0.07/0.03/0.03/0.79, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK)
Nov 14 10:17:21 ppday postfix/lmtp[19551]: 5DA0A21E37: to=s...@buffy.vmw,
relay=172.16.78.128[172.16.78.128]:2400, delay=0.93,
delays=0.07/0.03/0.03/0.79, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK)
Nov 14 10:17:21 ppday postfix/qmgr[20160]: 5DA0A21E37: removed

Any know bugs with global sieve vs mailboxes with dot in them ?
Can I enable more verbose sieve execution logs ?


Regards,
Thomas Cataldo,
Blue Mind

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: [patches] avoid unless exit()

2010-03-29 Thread Thomas Cataldo
On Tue, Mar 30, 2010 at 12:04 AM, Greg A. Woods woods-cy...@weird.comwrote:

 A memory leak is memory consumption by a computer program where the
 program is unable to release memory it has acquired.

 On a code path that definitively always ends with exit(2), all memory
 is, by definition, released.  Therefore there is no leak possible on
 any sure code path to exit().

 Relying on memory profilers which primarily try to determine memory
 leaks by reporting on unreleased memory left at the time of the exit()
 call is a fallacy sure to waste a lot of maintenance and coding time.

 The only time memory leaks are actually important is when the program
 continues to run!  Ideally the memory profiler must be triggered to
 report unreleased memory at the time the program restarts its main loop
 of execution in order to generate useful reports of unreleased memory.



Relying on exit freeing up memory is pretty lazy as it prevents switching to
threads.
Valgrind reports memory hold at exit time as a leak and I think it's a good
thing.

I'm only a java programmer using cyrus for its webmail need by I think that
fork/leak/leak/exit is a bad programming model.

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 APIs ?

2009-06-03 Thread Thomas Cataldo
2009/5/29 Bron Gondwana br...@fastmail.fm:
   - custom authentification mechanism (for single sign-on purpose,
 because kerberos doesn't fit everywhere)

 BYO saslauthd protocol daemon.  We have one written in Perl that does
 all sorts of clever.  Just put this in your imapd.conf

 sasl_pwcheck_method: saslauthd

 And have your daemon listen on a unix socket at:

 /var/state/saslauthd/mux

 You need to speak the saslauthd protocol, which is a packed string
 format.  We parse it in Perl like this:

  my $LoginName = get_counted_string($Self-{server}{client});
  my $Password = get_counted_string($Self-{server}{client});
  my $Service = lc get_counted_string($Self-{server}{client});
  my $Realm = get_counted_string($Self-{server}{client});

 And return one of:

  use constant SASL_SUCC_RESP  = pack(nA3, 2, OK\000);
  use constant SASL_FAIL_RESP  = pack(nA3, 2, NO\000);

 (with this function - slightly ugly code, but it works)

 sub get_counted_string {
  my $fh = shift;

  my ($rd, $data);

  ($rd = sysread($fh, $data, 2)    ) == 2
    or die Unable to read counted string size ($rd != 2) ($!);

  my $size = unpack(n, $data);

  $data = ''; $rd = 0; my $this_data = ''; my $rem_size = $size;
  while (my $this_rd = sysread($fh, $this_data, $rem_size)) {
    $rd += $this_rd;
    $rem_size -= $this_rd;
    $data .= $this_data;
  }
  die Unable to read counted string data ($rd != $size) ($!)
    unless ($rd  == $size);

  return unpack(A$size, $data);
 }


Thank you very much. This was so obvious but we might have sought that
replacing saslauthd would be complicated. Thanks a lot, we'll probably
solve everything with an homebrew saslauthd.

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 APIs ?

2009-05-28 Thread Thomas Cataldo
Hi,

We are building webmail  groupware software using cyrus for the mail
storage part. I'm wondering if any programming interface existed to
extend cyrus parts ?

Interesting things for us would be :
  - extending sieve (for exemple to implement in my organisation /
out of my organisation vacation messages)
  - IMAP protocol extensions (most needed thing would be to idle on
every folders, not just inbox)
  - custom authentification mechanism (for single sign-on purpose,
because kerberos doesn't fit everywhere)

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


Question about bodystructure answer on cyrus 2.2.13 (debian etch)

2008-09-30 Thread Thomas Cataldo
Hi,

I am writing an imap client library and I am confusing by one cyrus response.

Here is my telnet dialog with cyrus on a test server :

Trying 10.0.0.5...
Connected to 10.0.0.5.
Escape character is '^]'.
* OK obm Cyrus IMAP4 v2.2.13-Debian-2.2.13-10 server ready
A1 login [EMAIL PROTECTED] aliacom
A1 OK User logged in
A2 select inbox
* FLAGS (\Answered \Flagged \Draft \Deleted \Seen Junk NonJunk
$MDNSent receipt-handled $Label1 $Forwarded $label2)
* OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen Junk
NonJunk $MDNSent receipt-handled $Label1 $Forwarded $label2 \*)]
* 489 EXISTS
* 0 RECENT
* OK [UNSEEN 2]
* OK [UIDVALIDITY 1197326009]
* OK [UIDNEXT 5263]
A2 OK [READ-WRITE] Completed
A3 uid fetch 4826 (BODYSTRUCTURE)
* 78 FETCH (UID 4826 BODYSTRUCTURE ((TEXT PLAIN (CHARSET
ISO-8859-1 FORMAT flowed) NIL NIL 8BIT 137 8 NIL NIL
NIL)(MESSAGE RFC822 (NAME* {147}
ISO-8859-1''%6A%27%61%69%20%6C%61%6E%63%E9%20%75%6E%65%20%67%72%6F%73%73%65%20%69%6D%70%72%65%73%73%69%6F%6E%20%73%75%72%20%4C%50%32%33%30%30%52%56)
NIL NIL 8BIT 1544 (Wed, 14 Feb 2007 10:12:39 +0100 j'ai
=?ISO-8859-1?Q?lanc=E9_une_grosse_impression_sur_?=
=?ISO-8859-1?Q?LP2300RV?= ((Virginie Nouzies NIL virginie.nouzies
aliasource.fr)) ((Virginie Nouzies NIL virginie.nouzies
aliasource.fr)) ((Virginie Nouzies NIL virginie.nouzies
aliasource.fr)) ((Aliasource Toulouse NIL toulouse
aliasource.fr)) NIL NIL NIL [EMAIL PROTECTED])
(TEXT PLAIN (CHARSET ISO-8859-1 FORMAT flowed) NIL NIL
8BIT 137 8 NIL NIL NIL) 36 NIL (INLINE (FILENAME* {147}
ISO-8859-1''%6A%27%61%69%20%6C%61%6E%63%E9%20%75%6E%65%20%67%72%6F%73%73%65%20%69%6D%70%72%65%73%73%69%6F%6E%20%73%75%72%20%4C%50%32%33%30%30%52%56))
NIL) MIXED (BOUNDARY 020307030708000209000306) NIL
NIL))
A3 OK Completed (0.000 sec)

My problem is in the response to the body structure request : cyrus
tells me he will send me 147 bytes and my lib can deal with that. The
problem is, the data sent by cyrus is way longer than 147 bytes... can
someone point me to what I misunderstood ?

Regards, thomas.

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


Question about bodystructure answer on cyrus 2.2.13 (debian etch)

2008-09-30 Thread Thomas Cataldo
Hi,

I am writing an imap client library and I am confusing by one cyrus response.

Here is my telnet dialog with cyrus on a test server :

Trying 10.0.0.5...
Connected to 10.0.0.5.
Escape character is '^]'.
* OK obm Cyrus IMAP4 v2.2.13-Debian-2.2.13-10 server ready
A1 login [EMAIL PROTECTED] aliacom
A1 OK User logged in
A2 select inbox
* FLAGS (\Answered \Flagged \Draft \Deleted \Seen Junk NonJunk
$MDNSent receipt-handled $Label1 $Forwarded $label2)
* OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen Junk
NonJunk $MDNSent receipt-handled $Label1 $Forwarded $label2 \*)]
* 489 EXISTS
* 0 RECENT
* OK [UNSEEN 2]
* OK [UIDVALIDITY 1197326009]
* OK [UIDNEXT 5263]
A2 OK [READ-WRITE] Completed
A3 uid fetch 4826 (BODYSTRUCTURE)
* 78 FETCH (UID 4826 BODYSTRUCTURE ((TEXT PLAIN (CHARSET
ISO-8859-1 FORMAT flowed) NIL NIL 8BIT 137 8 NIL NIL
NIL)(MESSAGE RFC822 (NAME* {147}
ISO-8859-1''%6A%27%61%69%20%6C%61%6E%63%E9%20%75%6E%65%20%67%72%6F%73%73%65%20%69%6D%70%72%65%73%73%69%6F%6E%20%73%75%72%20%4C%50%32%33%30%30%52%56)
NIL NIL 8BIT 1544 (Wed, 14 Feb 2007 10:12:39 +0100 j'ai
=?ISO-8859-1?Q?lanc=E9_une_grosse_impression_sur_?=
=?ISO-8859-1?Q?LP2300RV?= ((Virginie Nouzies NIL virginie.nouzies
aliasource.fr)) ((Virginie Nouzies NIL virginie.nouzies
aliasource.fr)) ((Virginie Nouzies NIL virginie.nouzies
aliasource.fr)) ((Aliasource Toulouse NIL toulouse
aliasource.fr)) NIL NIL NIL [EMAIL PROTECTED])
(TEXT PLAIN (CHARSET ISO-8859-1 FORMAT flowed) NIL NIL
8BIT 137 8 NIL NIL NIL) 36 NIL (INLINE (FILENAME* {147}
ISO-8859-1''%6A%27%61%69%20%6C%61%6E%63%E9%20%75%6E%65%20%67%72%6F%73%73%65%20%69%6D%70%72%65%73%73%69%6F%6E%20%73%75%72%20%4C%50%32%33%30%30%52%56))
NIL) MIXED (BOUNDARY 020307030708000209000306) NIL
NIL))
A3 OK Completed (0.000 sec)

My problem is in the response to the body structure request : cyrus
tells me he will send me 147 bytes and my lib can deal with that. The
problem is, the data sent by cyrus is way longer than 147 bytes... can
someone point me to what I misunderstood ?

Regards, thomas.

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: Question about bodystructure answer on cyrus 2.2.13 (debian etch)

2008-09-30 Thread Thomas Cataldo
On Wed, Oct 1, 2008 at 1:32 AM, Bron Gondwana [EMAIL PROTECTED] wrote:
 On Tue, Sep 30, 2008 at 11:10:27PM +0200, Thomas Cataldo wrote:
 NIL)(MESSAGE RFC822 (NAME* {147}
 ISO-8859-1''%6A%27%61%69%20%6C%61%6E%63%E9%20%75%6E%65%20%67%72%6F%73%73%65%20%69%6D%70%72%65%73%73%69%6F%6E%20%73%75%72%20%4C%50%32%33%30%30%52%56)
 NIL NIL 8BIT 1544 (Wed, 14 Feb 2007 10:12:39 +0100 j'ai

 My problem is in the response to the body structure request : cyrus
 tells me he will send me 147 bytes and my lib can deal with that. The
 problem is, the data sent by cyrus is way longer than 147 bytes... can
 someone point me to what I misunderstood ?

 The 147 bytes is this bit here:
 ISO-8859-1''%6A%27%61%69%20%6C%61%6E%63%E9%20%75%6E%65%20%67%72%6F%73%73%65%20%69%6D%70%72%65%73%73%69%6F%6E%20%73%75%72%20%4C%50%32%33%30%30%52%56

 Which is just one ATOM.  All the stuff after this is other ATOMs,
 which aren't part of the 147 bytes.  You can easily get multiple
 ATOMs in a single response encoded in this way.

Thank you, I realized what I was doing wrong.


 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