On Mar 16, 2007, at 4:45 PM, nlin wrote:

I'm moving my users to a new mail server. On the old server, everything was under the home directory. So users were told to configure their imap settings and set the "IMAP Server directory" to "mail/". This caused problems because half my users did not configure it thus, and the other half did.

To make sure that everyone puts their mail all in the right place, for the new server, I changed the mailsubdir variable to "mail/" instead. This way, the mail server configuration would be much simpler.

However, now I have a new issue where users who are directed to change their mail server configurations leave the "mail/" setting in. So now their mail sits in 'mail/mail'. I can't have it work this way because I transferred all their email to 'mail/' and they can't see it.

Other than user education, is there any way to hack the code to make this transparent to the user? If a user issues an imap command to access 'mail/blah', the code would know to translate that to just 'blah'.

Before we switched to Cyrus, we used this patch with imap-2004g to catch the mail/ users:

@@ -924,6 +924,9 @@
   case '~':                    /* other user access */
                                /* bad syntax or anonymous can't win */
     if (!*++name || anonymous) dst = NIL;
+                               /* Translate ~/mail/foo to foo */
+    else if (*name == '/' && !strncmp (name+1,"mail/",5))
+      sprintf (dst,"%s/%s",mymailboxdir (),name+6);
                                /* ~/ equivalent to ordinary name */
else if (*name == '/') sprintf (dst,"%s/%s",mymailboxdir (),name +1); /* other user forbidden if closed/ restricted */
@@ -950,7 +953,11 @@
/* don't allow ~root/ if restricted root */
        if ((restrictBox & RESTRICTROOT) && !*pw->pw_dir) dst = NIL;
/* build final name w/ subdir if needed */ - else if (mailsubdir) sprintf (dst,"%s/%s/%s",pw- >pw_dir,mailsubdir,name);
+       else if (mailsubdir) {
+         /* Make sure mailsubdir is not included twice */
+         if (!strncmp(name,"mail/",5)) name+=5;
+         sprintf (dst,"%s/%s/%s",pw->pw_dir,mailsubdir,name);
+       }
        else sprintf (dst,"%s/%s",pw->pw_dir,name);
       }
       else dst = NIL;          /* no such user */


--
Matt
_______________________________________________
Imap-uw mailing list
Imap-uw@u.washington.edu
https://mailman1.u.washington.edu/mailman/listinfo/imap-uw

Reply via email to