On Thu, 2003-11-06 at 04:34, Raboo Treed wrote: > Isn't there a way to have like a "/etc/skel" but for vpopmail users > > like a skel with a dot qmail file and some extra imap folders.... and such? > > if not that would be a great feutre request..
Below is a copy of an email and patch submitted by David Winkler back in September to handle just that. --enable-vpopmail-skel=y Hello again, I seem to have answered my own question. Here is my unified diff against cvs if anyone is interested. Enjoy! David Index: vpopmail.c =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/vpopmail.c,v retrieving revision 1.2 diff -u -r1.2 vpopmail.c --- vpopmail.c 14 Sep 2003 22:17:30 -0000 1.2 +++ vpopmail.c 23 Sep 2003 19:12:45 -0000 @@ -1655,6 +1655,7 @@ struct vqpasswd *mypw; char calling_dir[MAX_BUFF]; char domain_dir[MAX_BUFF]; + char tmpbuf[MAX_BUFF]; verrori = 0; /* record the dir where the command was run from */ @@ -1701,6 +1702,7 @@ return(NULL); } +#ifndef ENABLE_VPOPMAIL_SKEL if (mkdir("Maildir",VPOPMAIL_DIR_MODE) == -1){ /* back out of changes made above */ chdir(domain_dir); chdir(user_hash); vdelfiles(username); @@ -1743,6 +1745,12 @@ /* set permissions on the user's dir */ chdir("../.."); +#else + sprintf(tmpbuf, "cp -rf %s/etc/skel/* %s/%s", VPOPMAILDIR,domain_dir,username); + system(tmpbuf); + chdir("../"); +#endif + r_chown(username, uid, gid); /* see if the user already exists in the auth backend */ Index: acconfig.h =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/acconfig.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 acconfig.h --- acconfig.h 10 Sep 2003 20:43:14 -0000 1.1.1.1 +++ acconfig.h 23 Sep 2003 19:12:45 -0000 @@ -1,3 +1,5 @@ +#undef ENABLE_VPOPMAIL_SKEL + #undef PS_COMMAND #undef ENABLE_PASSWD Index: Makefile.am =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/Makefile.am,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 Makefile.am --- Makefile.am 10 Sep 2003 20:43:12 -0000 1.1.1.1 +++ Makefile.am 23 Sep 2003 19:12:45 -0000 @@ -94,6 +94,12 @@ $(DESTDIR)@vpopmaildir@/@domains_dir@ $(INSTALL) -d $(DESTDIR)@vpopmaildir@/etc + $(INSTALL) -d $(DESTDIR)@vpopmaildir@/etc/skel + $(INSTALL) -d $(DESTDIR)@vpopmaildir@/etc/skel/Maildir + $(INSTALL) -d $(DESTDIR)@vpopmaildir@/etc/skel/Maildir/new + $(INSTALL) -d $(DESTDIR)@vpopmaildir@/etc/skel/Maildir/cur + $(INSTALL) -d $(DESTDIR)@vpopmaildir@/etc/skel/Maildir/tmp + echo "[EMAIL PROTECTED]@/include" > @vpopmaildir@/etc/inc_deps echo "[EMAIL PROTECTED]@/lib -lvpopmail @auth_libs@" > @vpopmaildir@/etc/lib_deps Index: configure.in =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/configure.in,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 configure.in --- configure.in 10 Sep 2003 20:43:11 -0000 1.1.1.1 +++ configure.in 23 Sep 2003 19:12:45 -0000 @@ -342,6 +342,23 @@ ;; esac +AC_ARG_ENABLE(vpopmail-skel, + [ --enable-vpopmail-skel=y|n Turn on (y) or off (n, default) to use +vpopmail skeleton for new users.], + ENABLE_VPOPMAIL_SKEL=$enableval, + [ + ENABLE_VPOPMAIL_SKEL=n + ]) + +case $ENABLE_VPOPMAIL_SKEL in +1*|y*|Y*) + ENABLE_VPOPMAIL_SKEL=1 + AC_DEFINE_UNQUOTED(ENABLE_VPOPMAIL_SKEL,$ENABLE_VPOPMAIL_SKEL) + ;; +*) + ;; +esac + AC_ARG_ENABLE(md5-passwords, [ --enable-md5-passwords=y|n Turn on (y default ) or off (n) to store encrypted passwords as md5.], ENABLE_MD5_PASSWORDS=$enableval, @@ -1315,6 +1332,15 @@ ;; esac +case $ENABLE_VPOPMAIL_SKEL in +1*|y*|Y*) +echo " vpop skel = ON --enable-vpopmail-skel=y" +echo " --enable-vpopmail-skel=y \\" >> vpopmail.config.sh + ;; +*) +echo " vpop skel = OFF --enable-vpopmail-skel=n (default)" + ;; +esac case $ENABLE_LOGGING in 1*|y*|Y*)