Are there files and/or directories in *both* the home directory and the /data/mail directory?
Files are in both directories (home and /data/mail).
Are you certain that your userid has access to the /data/mail directory?
Yes, I am sure.
Your sample shows it returning *nothing*, as if it is looking at a non-existant directory (INBOX always exist).
That's a point.
I just typed that in off the top of my head. I didn't try to test or debug it. You need to do that. Run gdb on imapd, and see what name mymailboxdir() actually builds and what kind of strings mailboxfile() puts together for path names.
Well, sorry for misunderstanding - I thought it's a code already checked up in other environment.
After examining other parts of code I decided to go for changing env_init procedure and ensure, that myHomeDir will be set up to point not to real home dir, but /data/mail/<user>. Simply changed line
myHomeDir = cpystr (home); /* set home directory */
to
sprintf (tmp,"/data/mail/%s",user); myHomeDir = cpystr (tmp);
Do you see any possible problems about this ? This looks more satisfying for me as I want all mail and imap related files (including configuration files) to be located in that specific directory, not in real home directory.
I understand chroot problems quite well, but in that case what should I go for to ensure, that users will be able to see only files in /data/mail/<user> ? I found restrictBox value but after some sort of critics about blackBox and closedBox choices I am not sure if it can be what I would like to go for ?...
Thank you again for you patience and kind help.
With best regards Martynas Buozis
