hello again.

after a bit of playing around i've identified three problems with virtual domains and the replication.  i've managed to put little band-aids on imapd.c and mboxname.c to get it to work but here's the big DISCLAIMER:  i know nothing about c so the fixes are probably clumsy or just plain wrong but seem to work.

i've included the patches but expect it's best to wait for a proper developer to have a look as i'm not too sure of any knock on effects they may have!  my testing continues.

rgds,
j.

Note:  this email applies to version cyrus version 2.3.1.  patches at bottom of mail.

1.     Invalid mailbox name when sync_client attempts a "CREATE domain!user" action.  fix was to add an ! to GOODCHARS in mboxname.c.  not too sure what repercussions this have.

2.  Creating a mailbox for a new virtual domain user fails when sync_client attempts a "USER userid" and failing with an "IOERROR ... Mailbox does not exist".
   -  imapd writes "USER userid" to the sync log not "USER userid<at>domain"
   -  i think this is because imapd passes mailboxname (form: domain!useridid) to mboxname_isusermailbox which strips off "domain!" to leave an unqualified userid.    
   -  sync_client attempts a USER function with,  i assume, the default domain for which the virtual domain user does not exist in... and fails.   
   -  unsure of any knock on affects of changing  mboxname_isusermailbox... i fixed it by taking the domain from mailboxname and appending it to userid. 
   -  because i don't know what i'm doing my fix leaves mailboxname in a funny state but as far as i can see it's not used after this. 

3.   When deleting the top of a mailbox tree imapd writes "MAILBOX domain!user.userid<at>domain" to the sync log.  this fails because it is not a valid mailbox format.   my solution was to change what's written to the sync log by stripping the "<at>domain" part off.  the proper solution,  i guess,  would be to fix how it got in this state in the first place.

patches...

**** mboxname.c.patch

653c653
< #define GOODCHARS " +,-.0123456789:[EMAIL PROTECTED]"
---
> #define GOODCHARS " +,-.0123456789:[EMAIL PROTECTED]"


**** imapd.c.patch

4567a4568
>     char *domain;
4693,4694c4694,4705
<       if ((userid = mboxname_isusermailbox(mailboxname, 1)))
<           sync_log_user(userid);
---
>       if ((userid = mboxname_isusermailbox(mailboxname, 1))) {
>               /* qualify userid if virtual domain.  at this point
>                  a virtualdomain userid is not qualified and needs
>                  to be. so use mailboxname to get userid to be user<at>domain.
>                  this leaves mboxname in an incorrect format but it doesnt
>                  look like its used after this */
>               if (config_virtdomains && (domain = strchr(mailboxname, '!'))) {
>                         *domain = '\0';  /* split domain!mbox */
>                         strcat(userid, "@");
>                         strcat(userid, mailboxname);
>         }
>           sync_log_user(userid); }
4733a4745
>     char *domain;
4839c4851,4854
<       /* XXX should sent a RESET here to cleanup meta-data */
---
>         /* clean up mailboxname which is in wrong format
>          of [EMAIL PROTECTED]  */
>         if (config_virtdomains && (domain = strchr(mailboxname, '@')))
>              *domain = '\0';  /* split [EMAIL PROTECTED] */







On Tue, 2006-01-24 at 23:01 +1300, jason neil wrote:
hi.
discovered it's probably not the full answer and just solves one particular
problem.   another problem seems to be when you create a new virtual domain,
imapd will write a USER entry to the /var/lib/imap/sync/log file but the
function it uses in mboxname.c to get the username strips the domain
information off it.   the sync_client reads the log and attempts a USER
operation but complains that the mail box doesn't exist - presumably because
it's looking for a mailbox in the default domain??

im just bumbling around really but will report anything interesting i find.
rgds,
j.

----
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
-- 
Unix   Systems   Administrator
Department of Computer Science
The  University   of  Auckland

Ph: (+64 9) 3737599 ext: 87422
----
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

Reply via email to