# HG changeset patch # User Timo Sirainen # Date 1180273527 -10800 # Node ID 1680709ec0a258d7dd2b000483385794a52090fb # Parent b796701a6927626c0d280a5fbcf798c04903d4f4 Don't expand %variables in mail setting coming from userdb. diff -r b796701a6927 -r 1680709ec0a2 src/deliver/deliver.c --- a/src/deliver/deliver.c Fri May 25 18:17:54 2007 +0300 +++ b/src/deliver/deliver.c Sun May 27 16:45:27 2007 +0300 @@ -665,19 +665,22 @@ mailbox_list_register_all(); /* MAIL comes from userdb, MAIL_LOCATION from dovecot.conf. + We don't want to expand settings coming from userdb. FIXME: should remove these and support namespaces.. */ mail_env = getenv("MAIL"); - if (mail_env == NULL) + if (mail_env == NULL) { mail_env = getenv("MAIL_LOCATION"); - if (mail_env == NULL) { - /* Keep this for backwards compatibility */ - mail_env = getenv("DEFAULT_MAIL_ENV"); + if (mail_env == NULL) { + /* Keep this for backwards compatibility */ + mail_env = getenv("DEFAULT_MAIL_ENV"); + } + if (mail_env != NULL) { + table = get_var_expand_table(destination, + getenv("HOME")); + mail_env = expand_mail_env(mail_env, table); + } + env_put(t_strconcat("MAIL=", mail_env, NULL)); } - if (mail_env != NULL) { - table = get_var_expand_table(destination, getenv("HOME")); - mail_env = expand_mail_env(mail_env, table); - } - env_put(t_strconcat("MAIL=", mail_env, NULL)); module_dir_init(modules);