[Imap-uw] individual folder for each mail user

Philipp Führer philipp.fuehrer at netzbeben.de
Thu Sep 28 06:08:36 PDT 2006


Hi Mark,
> The correct way to do this is to modify the routine mymailboxdir() in 
> env_unix.c, e.g.:
> static char *mymailboxdir ()
> {
>   if (!myMailboxDir && myHomeDir) {
>     char tmp[MAILTMPLEN];
>     sprintf (tmp,"/home/mailusers/%s",myusername ());
>     myMailboxDir = cpystr (tmp);
>   }
>   return myMailboxDir ? myMailboxDir : "";
> }
>
nice.

>
> I'm surprised that that worked at all.  That isn't what blackBoxDir 
> does nor how it is supposed to work.  I suggest that you don't use the 
> black box stuff at all, and instead you use the above patch.

i first tried to change mymailboxdir, but obviously i made a mistake. 
then i read somewhere to play around with blackBoxDir, whatever, with 
your hint everythings works now.

i had to do some changes, this is my solution for imap-2006a:

find and replace in src/osdep/unix/env_unix.h: (finds a nice place for 
.mailboxlist and .mblxlsttmp, individual for each user)
/* Subscription definitions for UNIX */
#define SUBSCRIPTIONFILE(t) sprintf (t,"%s/%s/.mailboxlist",myhomedir 
(), myusername())
#define SUBSCRIPTIONTEMP(t) sprintf (t,"%s/%s/.mlbxlsttmp",myhomedir (), 
myusername())

find and replace in srx/osdep/unix/env_unix.c: (returns an individual 
home mailbox directory for each user, creates needed directories if they 
don't exist)
/* Return my home mailbox name
* Returns: my home directory name
*/
static char *mymailboxdir ()
{
 char *home = myhomedir ();
 if (!myMailboxDir && myHomeDir) {
     char tmp[MAILTMPLEN];
     sprintf (tmp,"%s/%s",myhomedir(), myusername());
       struct stat stat_p;
   if ( -1 ==  stat (tmp, &stat_p))
       mkdir(tmp, 0711);

   sprintf (tmp,"%s/mail",tmp);                  if ( -1 ==  stat (tmp, 
&stat_p))
       mkdir(tmp, 0711);
         myMailboxDir = cpystr (tmp);
 }
 return myMailboxDir ? myMailboxDir : "";
}

then compile and install..

with these changes, .mailboxlist and .mlbxlsttmp will go to 
/home-of-users/individual-username and the mailboxes are stored into 
/home-of-users/individual-username/mail .
the home directoy of the users MUST exist, the other directories will be 
created automatically.

thanks a lot, Mark.

flipkick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman1.u.washington.edu/pipermail/imap-uw/attachments/20060928/b0a5aba2/attachment.htm


More information about the Imap-uw mailing list