[Dovecot] deliver & per user log file
Marcin Rzepecki
m.rzepecki at iem.pw.edu.pl
Mon Dec 15 02:48:05 EET 2008
Mon, Dec 15, 2008 at 12:45:43AM +0100, Thomas Siebert wrote:
> > I should start with this info ;) I'm running 1.1.7 I've tried with
> > many combinations: ~/Mail/deliver.log; Mail/deliver.log; deliver.log;
> > %h/Mail/deliver.log - without effect
>
> OK, I checked the sources and there is indeed no variable expansion code for
> this parameters. So for now, I don't see how it is possible from within
> dovecot. There are probably some cheesy ways to do it via filtering for some
> syslog daemons, but I feel that variables and "~" should be expanded here.
> As this should be no complicated fix, maybe when Timo reads this he
> introduces it in the next version.
>
>
> Changing two lines in deliver.c and recompiling could provisionally work
> [...]
Now 'log_path = %h/.MAIL/deliver.log' works for me! Thank you, Thomas!
Here's a patch if someone would like to test this feature:
--- src/deliver/deliver.c.orig 2008-11-19 18:43:13.000000000 +0100
+++ src/deliver/deliver.c 2008-12-15 01:30:38.000000000 +0100
@@ -682,7 +682,8 @@
const char *prefix, *log_path, *stamp;
prefix = t_strdup_printf("deliver(%s)", username);
- log_path = getenv("LOG_PATH");
+ log_path = expand_mail_env( getenv("LOG_PATH"),
+ get_var_expand_table(username, getenv("HOME")) );
if (log_path == NULL || *log_path == '\0') {
const char *env = getenv("SYSLOG_FACILITY");
int facility;
@@ -695,7 +696,8 @@
i_set_failure_file(log_path, t_strconcat(prefix, ": ", NULL));
}
- log_path = getenv("INFO_LOG_PATH");
+ log_path = expand_mail_env( getenv("INFO_LOG_PATH"),
+ get_var_expand_table(username, getenv("HOME")) );
if (log_path != NULL && *log_path != '\0')
i_set_info_file(log_path);
--
Marcin Rzepecki
m.rzepecki(at)iem.pw.edu.pl
More information about the dovecot
mailing list