Hello all, While configuring the latest stable version of Dovecot (1.0.3), I've noticed that "deliver" always uses the quota arguments found in the configuration file, completely ignoring what userdb sends to it through the authentication service. This doesn't happen in the previous version I was used (1.0.rc15, comes with Debian "etch").
After digging a little into the code, I've found that "expand_envs" is being called after "auth_client_put_user_env", thus clobbering the "QUOTA" environment variable. The attached patch changes "expand_envs" to avoid setting "QUOTA" if it has been exported before. Thanks! -- Sergio López - <[EMAIL PROTECTED]> Nologin Consulting S.L. - http://nologin.es
--- dovecot-1.0.3.orig/src/deliver/deliver.c 2007-07-23 07:06:48.000000000 +0200 +++ dovecot-1.0.3/src/deliver/deliver.c 2007-08-23 14:04:40.000000000 +0200 @@ -492,12 +492,22 @@ const struct var_expand_table *table; const char *mail_env, *const *envs; unsigned int i, count; + bool omit_quota = FALSE; string_t *str; str = t_str_new(256); table = get_var_expand_table(destination, getenv("HOME")); envs = array_get(&plugin_envs, &count); + + if (getenv("QUOTA") != NULL) + omit_quota = TRUE; + for (i = 0; i < count; i++) { + /* If userdb already set quota env, don't clobber it. */ + if (omit_quota == TRUE) { + if (strstr(envs[i], "QUOTA=") != NULL) + continue; + } str_truncate(str, 0); var_expand(str, envs[i], table); env_put(str_c(str));