After patch, vsetuserquota seems to be ok. But problem still exist if the email account is created or amended by qmailadmin.
Any other suggestion ?
I guess you're right. I'm surprised no one reported this earlier -- this code has been in vpopmail for many releases now. The previous patch to vsetuserquota.c is unnecessary, use this patch to vpopmail.c instead.
--- vpopmail.c 22 Feb 2004 22:50:48 -0000 1.29
+++ vpopmail.c 1 Mar 2004 15:33:18 -0000
@@ -1543,6 +1543,7 @@
int vsetuserquota( char *username, char *domain, char *quota )
{
struct vqpasswd *mypw;
+ char *formattedquota;
int ret; if ( strlen(username) >= MAX_PW_NAME ) return(VA_USER_NAME_TOO_LONG);
@@ -1558,7 +1559,8 @@
/* correctly format the quota string,
* and then store the quota into the auth backend
*/
- ret = vauth_setquota( username, domain, format_maildirquota(quota));
+ formattedquota = format_maildirquota(quota);
+ ret = vauth_setquota( username, domain, formattedquota);
if (ret != VA_SUCCESS ) return(ret); mypw = vauth_getpw( username, domain );
@@ -1569,7 +1571,7 @@
char maildir[MAX_BUFF];
snprintf(maildir, sizeof(maildir), "%s/Maildir/", mypw->pw_dir);
umask(VPOPMAIL_UMASK);
- (void)vmaildir_readquota(maildir, quota);
+ (void)vmaildir_readquota(maildir, formattedquota);
if ( vget_assign(domain, NULL, 0, &uid, &gid)!=NULL) {
strcat(maildir, "maildirsize");
chown(maildir,uid,gid);-- 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/
