From: Timo Sirainen Date: Sun, 24 Aug 2003 13:14:47 +0000 (+0300) Subject: Added mail_chroot setting to specify default chroot. X-Git-Tag: 1.1.alpha1~4372 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29017508d62e138c427a87e5e820a702996c218d;p=thirdparty%2Fdovecot%2Fcore.git Added mail_chroot setting to specify default chroot. --HG-- branch : HEAD --- diff --git a/dovecot-example.conf b/dovecot-example.conf index 9314477ab2..32d06751d1 100644 --- a/dovecot-example.conf +++ b/dovecot-example.conf @@ -145,6 +145,10 @@ # allow shell access for users. See doc/configuration.txt for more information. #valid_chroot_dirs = +# Default chroot directory for mail processes. This can be overridden by +# giving /./ in user's home directory (eg. /home/./user chroots into /home). +#mail_chroot = + # Default MAIL environment to use when it's not set. By leaving this empty # dovecot tries to do some automatic detection as described in # doc/mail-storages.txt. There's a few special variables you can use: diff --git a/src/master/mail-process.c b/src/master/mail-process.c index 7fc9267cac..b51d96f179 100644 --- a/src/master/mail-process.c +++ b/src/master/mail-process.c @@ -156,6 +156,9 @@ int create_mail_process(struct login_group *group, int socket, home_dir = data + reply->home_idx; chroot_dir = data + reply->chroot_idx; + if (*chroot_dir == '\0') + chroot_dir = set->mail_chroot; + if (*chroot_dir != '\0' && !validate_chroot(set, chroot_dir)) { i_error("Invalid chroot directory: %s", chroot_dir); return FALSE; diff --git a/src/master/master-settings.c b/src/master/master-settings.c index 834d32c2b5..37a7b84079 100644 --- a/src/master/master-settings.c +++ b/src/master/master-settings.c @@ -68,6 +68,7 @@ static struct setting_def setting_defs[] = { /* mail */ DEF(SET_STR, valid_chroot_dirs), + DEF(SET_STR, mail_chroot), DEF(SET_INT, max_mail_processes), DEF(SET_BOOL, verbose_proctitle), diff --git a/src/master/master-settings.h b/src/master/master-settings.h index 21b5047728..8fea5ba14b 100644 --- a/src/master/master-settings.h +++ b/src/master/master-settings.h @@ -45,6 +45,7 @@ struct settings { /* mail */ const char *valid_chroot_dirs; + const char *mail_chroot; unsigned int max_mail_processes; int verbose_proctitle;