I just had to write this up quickly to re-generate .dir-control (or in MySQL, 
the dir-control table)
for a system whose .dir-control file was corrupted.  Figured I'd pass it on.

Replace test.com with domain with .dir-control problems
Number_of_existing_users means just what it says; Set it to the correct user 
I recommend running this in a temporary directory.  next_big_dir is going to 
all the hash directories in the CWD.  All you really need created is the last 
which it will print out.

Oh, and make sure to delete .dir-control (or drop table dir-control in MySQL) 
running this.

  char *user_hash = NULL;
  int uid = 89, gid = 89;
  unsigned long i =0;
  unsigned long number_of_existing_users = 60000;

  open_big_dir("test.com", uid, gid);

  for (i = 0; i < number_of_existing_users; i++)
      user_hash = next_big_dir(uid, gid);

   printf("Create directory: ~vpopmail/domains/test.com/%s\n", user_hash);
   close_big_dir("test.com", uid, gid;
    Matt Brookings <[EMAIL PROTECTED]>       GnuPG Key ABA26FE7
    Software developer                     Systems technician
    Inter7 Internet Technologies, Inc.     (815)776-9465

Reply via email to