Thank you for providing such a great software.

I am managing domain 'examp.le' under vpopmail. 

/home/vpopmail/domains/examp.le/vpasswd
----------------------------------------------------------------
virtual:????????:1:0:virtual:/home/vpopmail/domains/examp.le/virtual:NOQUOTA:XXXXXXXX
real:????????:1:0:real:/home/real:NOQUOTA:XXXXXXXX
----------------------------------------------------------------

There are two users under this domain: virtual and real.

* 'virtual' - the virtual user having mailbox
  under ~vpopmail/domains/examp.le/virtual/Maildir
* 'real' - the real user having mailbox under ~real/Maildir

I want to use vpopmail to provide POP service for both of these users,
but locate real's mailbox under ~real and keep its uid/gid to real's.

So I changed the directory part of real's entry in vpasswd file to
/home/real, but POP authentication fails.

vchkpw-pop3: (APOP) login success [EMAIL PROTECTED]:192.168.0.118
vchkpw-pop3: autocreate dir errno 13 /home/real [EMAIL PROTECTED]:192.168.0.118

vchkpw seems to drops uid & gid to vpopmail:vchkpw before accessing to
/home/real.(rw-------) How can I make vchkpw & qmail-pop3d to read
mails from /home/real?

(Now I am doing that by patching vchkpw.c.)
*** vchkpw.c    2004/04/26 05:46:50     1.1
--- vchkpw.c    2004/04/26 06:11:26
***************
*** 23,28 ****
--- 23,29 ----
  #include <string.h>
  #include <syslog.h>
  #include <errno.h>
+ #include <sys/stat.h>
  #include <sys/wait.h>
  #include <pwd.h>
  #include <sys/types.h>
***************
*** 183,188 ****
--- 184,203 ----
    if ( (vpw = vauth_getpw(TheUser, TheDomain)) != NULL ) {
      vget_assign(TheDomain,NULL,0,&pw_uid,&pw_gid);
      login_virtual_user();
+     /* Obtain uid & gid from the virtual home directory. */
+     {
+       struct stat vhomedir_stat;
+       if (stat(pw_dir, vhomedir_stat) != 0) {
+         snprintf(LogLine, sizeof(LogLine), 
+           "%s: stat failed (errno %d) %s [EMAIL PROTECTED]:%s", 
+           VchkpwLogName, errno, pw_dir, TheUser, TheDomain, IpAddr);
+         vlog(VLOG_ERROR_INTERNAL, TheUser, TheDomain, ThePass, 
+                                   TheName, IpAddr, LogLine);
+         vchkpw_exit(6);
+       }
+       pw_uid = vhomedir_stat.st_uid;
+       pw_gid = vhomedir_stat.st_gid;
+     }
  
  #ifdef ENABLE_PASSWD
    /* if it is not in the virtual domains 

-- 
Shirai,Kaoru <[EMAIL PROTECTED]>
Korinkan Ltd. - http://www.korinkan.co.jp/

Reply via email to