On Wed, 27 Sep 2006, Philipp Führer wrote:
i'm working with a system where are all mail users use the same home directory /home/mailusers. i can't change the home directory because of an other applications which needs this configuration. now i want imapd to use an alternate home-directory for each user. like /home/mailusers/user1 for user no. 1, /home/mailusers/user2 for user no.2 and so on.

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 : "";
}

You need the check for myHomeDir to make sure that myMailboxDir isn't set to the root name prior to login.

I tried changing blackBoxDir in env_unix.c to the specific Username. i did this by adding
blackBoxDir = cpystr(myUserName); to the function env_init.

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.

what would be a good point to look at to find the functions of imapd which create those mailboxes. i had my problems browsing the source.

Mailbox creation is a complex matter. Ultimately, it goes to the particular driver which is going to create the files in the determined format.

I suggest that you not worry about that. You had the right idea by going into the environment routines in env_unix.c; you just picked the wrong way to do it.

-- Mark --

http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.
_______________________________________________
Imap-uw mailing list
Imap-uw@u.washington.edu
https://mailman1.u.washington.edu/mailman/listinfo/imap-uw

Reply via email to