Re: [vchkpw] Custom Maildir Structure
On Monday 29 November 2004 18:56, Robin Bowes wrote: Also, I envisage allowing different skel dirs per domain, i.e. look in domain/etc/skel first, then vpopmail home/etc/skel, then create the default Maildir structure. Fantastic idea. This would allow me to add Spam directories for domains who have purchased spam filtering, but not for all domains. domain/etc/skel won't work though, because I might have a user named etc. Maybe domain/.skel or vpopmail home/etc/domain/skel? Cheers, -- Casey Allen Shobe - Open Source Software Solutions [EMAIL PROTECTED] - http://osss.net
Re: [vchkpw] Custom Maildir Structure
On Mon, November 29, 2004 8:16 am, Tom Collins said: Yes. Absolutely. Fantastic. I was just wondering about this the other day and was about to write a bunch of nasty frontend scripts to vpopmail to workaround this issue. I prefer to use an IMAPdir structure instead of Maildir++, and would like a few additional folders created and subscribed to by default for antispam purposes. Cheers, -- Casey Allen Shobe | AIM/Yahoo: SomeLinuxGuy [EMAIL PROTECTED] | ICQ: 1494523
Re: [vchkpw] Custom Maildir Structure
Yes. I'm suggesting that we could use directory names outside of the user namespace so that you could have bigdir support and one-character email addresses at the same time. It would be difficult to handle existing domains though... There would need to be a lot of directory renaming and updating of the user database to pull it off. This is probably a silly idea but... You could always write a dot-file, e.g. .domain-version, that contains the 'version number' of the domain layout. If the file doesn't exist of if the 'version number' is, say, 1, vpopmail uses the old convention for bigdir. If the 'version number' is, say, 2, vpomail uses the new convention. A program could be written to convert between domain versions. The advantage to this is that it wouldn't automatically require conversion for new domains when vpopmail is upgraded. The disadvantages are that it may be overly complex/complicated and, well, it does seem rather silly. (That said, I use something like this on a website so I can track the versions of the SQL schemas so I can pass along intelligent upgrade scripts to the website maintainer.) Sincerely, Chris Ess System Administrator / CDTT (Certified Duct Tape Technician)
Re: [vchkpw] Custom Maildir Structure
Tom Collins wrote: On Nov 28, 2004, at 6:59 AM, Robin Bowes wrote: Can you you point me to a link to this patch - I can't seem to find it on vpopmail.sf.net. I guess I was mistaken -- the patch never made it to SourceForge. Here it is. I declined to add it because it runs cp via a system() call. I'd prefer to have vpopmail manage the copying itself. So, basically all that's required is a copy_directory function to replace the system call the cp? And you'll accept the patch? R. -- http://robinbowes.com
Re: [vchkpw] Custom Maildir Structure
On Nov 29, 2004, at 5:19 AM, Robin Bowes wrote: Tom Collins wrote: On Nov 28, 2004, at 6:59 AM, Robin Bowes wrote: Can you you point me to a link to this patch - I can't seem to find it on vpopmail.sf.net. I guess I was mistaken -- the patch never made it to SourceForge. Here it is. I declined to add it because it runs cp via a system() call. I'd prefer to have vpopmail manage the copying itself. So, basically all that's required is a copy_directory function to replace the system call the cp? And you'll accept the patch? Yes. Absolutely. Maybe a configuration option for the location of the directory, but that isn't a huge deal. I'd like to see it use the default Maildir creation if the skel directory doesn't exist (or isn't readable) and copy the skel directory (which will need to contain Maildir (or .maildir) and its subdirs new, cur and tmp) if it does exist. -- Tom Collins - [EMAIL PROTECTED] QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/ Info on the Sniffter hand-held Network Tester: http://sniffter.com/
Re: [vchkpw] Custom Maildir Structure
Tom Collins wrote: On Nov 29, 2004, at 5:19 AM, Robin Bowes wrote: So, basically all that's required is a copy_directory function to replace the system call the cp? And you'll accept the patch? Yes. Absolutely. Maybe a configuration option for the location of the directory, but that isn't a huge deal. I'd like to see it use the default Maildir creation if the skel directory doesn't exist (or isn't readable) and copy the skel directory (which will need to contain Maildir (or .maildir) and its subdirs new, cur and tmp) if it does exist. This should be configurable - if you've got an infrastructure that relies on a particular mailbox structure then you want to know if it doesn't get created correctly when a user is added. Also, I envisage allowing different skel dirs per domain, i.e. look in domain/etc/skel first, then vpopmail home/etc/skel, then create the default Maildir structure. R. -- http://robinbowes.com
Re: [vchkpw] Custom Maildir Structure
On Nov 29, 2004, at 10:56 AM, Robin Bowes wrote: Also, I envisage allowing different skel dirs per domain, i.e. look in domain/etc/skel first, then vpopmail home/etc/skel, then create the default Maildir structure. Consider domain/@skel/ as the source. Using domain/etc/skel causes problems if someone wants to use skel as an email address or mailing list. Since a username can't have @ in it, it should be a safe directory character to use. That also got me to thinking about how bigdir support means it's not possible to have one-letter email addresses/lists. By using @a, @b, @c, etc. as the directory names, any email address would be possible. -- Tom Collins - [EMAIL PROTECTED] QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/ Info on the Sniffter hand-held Network Tester: http://sniffter.com/
Re: [vchkpw] Custom Maildir Structure
Tom Collins wrote: That also got me to thinking about how bigdir support means it's not possible to have one-letter email addresses/lists. By using @a, @b, @c, etc. as the directory names, any email address would be possible. I've already though about that and got concerned with it. Are you suggesting a modification to vpopmail's bigdir support? -- Regards, Eduardo M. Bragatto.
Re: [vchkpw] Custom Maildir Structure
Tom Collins wrote: On Nov 29, 2004, at 10:56 AM, Robin Bowes wrote: Also, I envisage allowing different skel dirs per domain, i.e. look in domain/etc/skel first, then vpopmail home/etc/skel, then create the default Maildir structure. Consider domain/@skel/ as the source. Using domain/etc/skel causes problems if someone wants to use skel as an email address or mailing list. Since a username can't have @ in it, it should be a safe directory character to use. That makes sense. David Winkler has sent me a version of vpopmail that uses a copytree function. When I get time, I'll apply the existing patch, include the copytree functionality and vpopmail home/skel and domain/@skel support and produce a new patch. Any preferences as to which source I should patch against? What command would you like me to use to make the patch? That also got me to thinking about how bigdir support means it's not possible to have one-letter email addresses/lists. By using @a, @b, @c, etc. as the directory names, any email address would be possible. I'll leave that to you! :) R. -- http://robinbowes.com
Re: [vchkpw] Custom Maildir Structure
Tom Collins wrote: On Nov 29, 2004, at 5:19 AM, Robin Bowes wrote: Tom Collins wrote: On Nov 28, 2004, at 6:59 AM, Robin Bowes wrote: Can you you point me to a link to this patch - I can't seem to find it on vpopmail.sf.net. I guess I was mistaken -- the patch never made it to SourceForge. Here it is. I declined to add it because it runs cp via a system() call. I'd prefer to have vpopmail manage the copying itself. So, basically all that's required is a copy_directory function to replace the system call the cp? And you'll accept the patch? Yes. Absolutely. Maybe a configuration option for the location of the directory, but that isn't a huge deal. May I suggest: ~vpopmail/domains/$DOMAIN/.skel if it exists, else ~vpopmail/skel That way you can define a system wide default, and override it on a per domain basis.
Re: [vchkpw] Custom Maildir Structure
On Nov 29, 2004, at 6:43 PM, Eduardo M. Bragatto wrote: That also got me to thinking about how bigdir support means it's not possible to have one-letter email addresses/lists. By using @a, @b, @c, etc. as the directory names, any email address would be possible. I've already though about that and got concerned with it. Are you suggesting a modification to vpopmail's bigdir support? Yes. I'm suggesting that we could use directory names outside of the user namespace so that you could have bigdir support and one-character email addresses at the same time. It would be difficult to handle existing domains though... There would need to be a lot of directory renaming and updating of the user database to pull it off. -- Tom Collins - [EMAIL PROTECTED] QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/ Info on the Sniffter hand-held Network Tester: http://sniffter.com/
Re: [vchkpw] Custom Maildir Structure
Tom Collins wrote: There is a patch on SourceForge to add skel directory support to vpopmail, but we decided not to include it since it uses a system call to 'cp' to copy the files -- it would be better to do the copying within vpopmail itself. Tom, Can you you point me to a link to this patch - I can't seem to find it on vpopmail.sf.net. R. -- http://robinbowes.com
Re: [vchkpw] Custom Maildir Structure
On Nov 28, 2004, at 6:59 AM, Robin Bowes wrote: Can you you point me to a link to this patch - I can't seem to find it on vpopmail.sf.net. I guess I was mistaken -- the patch never made it to SourceForge. Here it is. I declined to add it because it runs cp via a system() call. I'd prefer to have vpopmail manage the copying itself. Patch from David Winkler to copy a set of files into the home directory of newly created users. 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 - 1.2 +++ vpopmail.c 23 Sep 2003 19:12:45 - @@ -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 - 1.1.1.1 +++ acconfig.h 23 Sep 2003 19:12:45 - @@ -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 - 1.1.1.1 +++ Makefile.am 23 Sep 2003 19:12:45 - @@ -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.in10 Sep 2003 20:43:11 - 1.1.1.1 +++ configure.in23 Sep 2003 19:12:45 - @@ -342,6 +342,23 @@ ;; esac +AC_ARG_ENABLE(vpopmail-skel, + [ --enable-vpopmail-skel=y|nTurn 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*) -- Tom Collins - [EMAIL PROTECTED] QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/ Info on the Sniffter hand-held Network Tester: http://sniffter.com/
Re: [vchkpw] Custom Maildir Structure
Jeremy Eder wrote: I know of a patch currently under development (very near done, must be translated to English) for this exact function. Coder calls it /etc/skel functionality for vpopmail. If anyone else knows of another patch/method, please post. I will post a link to the patch when it's complete. Also, I understand it will be submitted to Inter7 for their review... Jeremy, Any news on this patch? R. -- http://robinbowes.com
RE: [vchkpw] Custom Maildir Structure
-Original Message- From: Robin Bowes [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 23, 2004 7:40 AM To: [EMAIL PROTECTED] Subject: [vchkpw] Custom Maildir Structure Hi, I use bincimap with vpopmail and use the IMAPDir structure which looks like this: domains | +-domain | +-user | +-IMAPDir | | | +-INBOX - ../Maildir | +-Maildir | +-new | +-cur | +-tmp Is it possible to configure vpopmail (i.e. vadduser) and, by extension, qmailadmin to create this structure automatically when I new user is added? i.e. Does vpopmail support the concept of a skel directory like the adduser command uses /etc/skel ? Thanks, R. -- http://robinbowes.com I know of a patch currently under development (very near done, must be translated to English) for this exact function. Coder calls it /etc/skel functionality for vpopmail. If anyone else knows of another patch/method, please post. I will post a link to the patch when it's complete. Also, I understand it will be submitted to Inter7 for their review... Best Regards, Jeremy Eder Hi-Tek Data Corp. V: 516.797.8800 F: 516.797.8892
Re: [vchkpw] Custom Maildir Structure
On Nov 23, 2004, at 4:39 AM, Robin Bowes wrote: Is it possible to configure vpopmail (i.e. vadduser) and, by extension, qmailadmin to create this structure automatically when I new user is added? i.e. Does vpopmail support the concept of a skel directory like the adduser command uses /etc/skel ? If you just need a particular directory structure, you can modify vpopmail.c's list of directories to create for each user: const char *dirnames[] = {Maildir, Maildir/new, Maildir/cur, Maildir/tmp}; You'll have to manually add code before: /* set permissions on the user's dir */ r_chown(., uid, gid); To create the symlink from INBOX to ../Maildir. There is a patch on SourceForge to add skel directory support to vpopmail, but we decided not to include it since it uses a system call to 'cp' to copy the files -- it would be better to do the copying within vpopmail itself. -- Tom Collins - [EMAIL PROTECTED] QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/ Info on the Sniffter hand-held Network Tester: http://sniffter.com/