]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Added mail_chroot setting to specify default chroot.
authorTimo Sirainen <tss@iki.fi>
Sun, 24 Aug 2003 13:14:47 +0000 (16:14 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 24 Aug 2003 13:14:47 +0000 (16:14 +0300)
--HG--
branch : HEAD

dovecot-example.conf
src/master/mail-process.c
src/master/master-settings.c
src/master/master-settings.h

index 9314477ab2c9e9e6091d66440dc400cdd757591c..32d06751d125cda01bd2263d38d22a6128c67df1 100644 (file)
 # 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:
index 7fc9267cac1518d9ec1078b2f2e17c2666856b86..b51d96f17949e4df249180869181383eedfd0eea 100644 (file)
@@ -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;
index 834d32c2b54c339b4356193b86b42554f46270ee..37a7b8407970d7055552fdf0a72ab480e08b0360 100644 (file)
@@ -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),
 
index 21b5047728273ceae4e0cb185e4126db518cfa25..8fea5ba14b91a35c0acb329ec717ed11cfc88ba0 100644 (file)
@@ -45,6 +45,7 @@ struct settings {
 
        /* mail */
        const char *valid_chroot_dirs;
+       const char *mail_chroot;
        unsigned int max_mail_processes;
        int verbose_proctitle;