From: Tom C. <to...@to...> - 2005-04-08 04:35:01
|
On Apr 5, 2005, at 12:11 PM, Tom Collins wrote: > On Apr 5, 2005, at 12:02 PM, Victor wrote: >> How I can change folder structure of Maildir to: >> "/mailhome/domains/mydomain.com/u/user" ?? > > Modify make_user_dir() in vpopmail.c. Here's the patch to accomplish your request. --- vp-5.4/vpopmail.c 2005-02-28 18:17:37.000000000 -0700 +++ vp-hash/vpopmail.c 2005-04-07 21:28:21.000000000 -0700 @@ -1704,7 +1704,7 @@ */ char *make_user_dir(char *username, char *domain, uid_t uid, gid_t gid) { - char *user_hash; + static char user_hash[2]; struct vqpasswd *mypw; char calling_dir[MAX_BUFF]; char domain_dir[MAX_BUFF]; @@ -1725,14 +1725,12 @@ /* go to the dir for our chosen domain */ chdir(domain_dir); - user_hash=""; -#ifdef USERS_BIG_DIR - /* go into a user hash dir if required */ - open_big_dir(domain, uid, gid); - user_hash = next_big_dir(uid, gid); - close_big_dir(domain, uid, gid); - chdir(user_hash); -#endif + /* make hash the first letter of the username */ + sprintf (user_hash, "%c", *username); + if (chdir(user_hash) != 0) { + r_mkdir (user_hash, uid, gid); + chdir (user_hash); + } /* check the length of the dir path to make sure it is not too long to save back to the auth backend */ if ((strlen(domain_dir)+strlen(user_hash)+strlen(username)) > MAX_PW_DIR) { -- Tom Collins - to...@to... QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/ You don't need a laptop to troubleshoot high-speed Internet: sniffter.com |