[dovecot-cvs] dovecot-1.0: Don't expand %variables in mail setting coming from...

dovecot at dovecot.org dovecot at dovecot.org
Sun May 27 16:45:31 EEST 2007


details:   http://hg.dovecot.org/dovecot-1.0/rev/2b462faf9867
changeset: 5288:2b462faf9867
user:      Timo Sirainen <tss at iki.fi>
date:      Sun May 27 16:45:26 2007 +0300
description:
Don't expand %variables in mail setting coming from userdb.

diffstat:

1 file changed, 12 insertions(+), 9 deletions(-)
src/deliver/deliver.c |   21 ++++++++++++---------

diffs (33 lines):

diff -r 89aa4c7f40b7 -r 2b462faf9867 src/deliver/deliver.c
--- a/src/deliver/deliver.c	Thu May 24 11:34:46 2007 +0300
+++ b/src/deliver/deliver.c	Sun May 27 16:45:26 2007 +0300
@@ -638,17 +638,20 @@ int main(int argc, char *argv[])
         mail_storage_init();
 	mail_storage_register_all();
 
-	/* MAIL comes from userdb, MAIL_LOCATION from dovecot.conf */
+	/* MAIL comes from userdb, MAIL_LOCATION from dovecot.conf.
+	   We don't want to expand settings coming from userdb. */
 	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) {
-		table = get_var_expand_table(destination, getenv("HOME"));
-		mail_env = expand_mail_env(mail_env, table);
+		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);
+		}
 	}
 
 	module_dir_init(modules);


More information about the dovecot-cvs mailing list