Subject: setting *mailsubdir only if not set via client?

From: Dallas N Antley <[email-masked]>
Date: Tue, 30 Nov 2004 17:00:41 -0500

Short question:  Can the *mailsubdir string be appended if, and only
if, an IMAP client folder LIST doesn't include a directory?  If not,
can anyone think of a method to strip off a directory name included in
a LIST command?

Current system:

  Solaris 8/SPARC, using imap-2004b.DEV.SNAP-0411051435.
  *mailsubdir= NIL;
  *sysinbox = ... sprintf (tmp,"%s/.mail",myhomedir ());

I've been using IMAP for a long time (since 1998), and I have a
remarkable variety of "vintage" IMAP clients.  At the time, UW-IMAP
didn't support the *mailsubdir option, so I configured the on-campus
mail clients to store their folders in "Mail/".  With the current
Mozilla clients, this option is called the "IMAP Server Directory".

Unfortunately, I now have a number of users who have mis-configured
their home Mozilla/Netscape clients, and who haven't set this
directory.  Thus, they can't see their on-campus mailboxes, or delete
Unix-side files in $HOME, etc.  Since I can't enforce client-side
options before they connect to the IMAP server, I need to change the
IMAP server's default mail directory to "Mail/".

I've looked at the code in src/osdep/unix/env_unix.c, the *mailsubdir
variable, and and the mymailboxdir() function.  If I set the string to
"Mail", it will always prepend the subdirectory to the path.  This may
work fine with the misconfigured clients, but then the rest of the
mail clients would be looking in "Mail/Mail" for their folders, which
won't work.  

While I can modify these on-campus client configs, it will take some
time.  I need an interim solution where I could have both "" and
"Mail" map to the same mailboxes.

Can anyone make a suggestion on how I can make both of these work?
I've been toying with DoveCot 1.0 and using its "private namespace"
feature, but I don't think it's ready for large-scale use just yet. 

Thank you for any ideas you can provide.

			Dallas
-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Tue, 30 Nov 2004 14:17:52 -0800 (Pacific Standard Time)

In my opinion, it's better to leave things alone and allow people to use 
Mail/ or whatever other subdirectory name they want.  For all you know, 
some power user may want to reference his home directory.

If you really want to go ahead with your intended strategy, then do 
something like the following early in routine mailboxfile():

   size_t i = mailsubdir ? strlen (mailsubdir) : 0;
   if (i && !strncmp (name,mailsubdir,i) && (name[i] == '/')) name += i + 1;

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.

---

From: Dallas N Antley <[email-masked]>
Date: Tue, 30 Nov 2004 20:39:18 -0500

> some power user may want to reference his home directory.

I agree with you.  However, I'd rather the power-user go through the
effort of configuring their "IMAP Server Directory" to something like
"~/" or some private namespace to get full access.  I'm getting tired
of restoring some less-experienced person's research files that they
accidentally deleted via IMAP.

Plus, we're looking to go to a black-box mode, so we need to phase out
the client-side directory setting anyways.  I'd prefer not to have to
break both the clients and the server at the same time.

Thanks for the recommendation.  I'll try that out.

		      Dallas