Discussion:
[Dovecot] separate partition for index/uidlist
Daniel
2007-03-11 17:40:03 UTC
Permalink
Hi!

What's a safe place for the separate index and uidlist files? I am
planning to configure Quota/FS. Can they reside under dovecot's
basedir? Is this a good idea? Does it have any significance where I put
those files?

Thanks,

Daniel
Timo Sirainen
2007-03-11 17:53:41 UTC
Permalink
Post by Daniel
What's a safe place for the separate index and uidlist files? I am
planning to configure Quota/FS. Can they reside under dovecot's
basedir? Is this a good idea?
Dovecot's base_dir is usually under /var/run, which some OSes delete at
boot. So it's not a very good location for it.
Post by Daniel
Does it have any significance where I put those files?
No. Some people use eg. /var/indexes.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20070311/fe74afd2/attachment.pgp
Daniel
2007-03-11 18:17:25 UTC
Permalink
Post by Timo Sirainen
Post by Daniel
What's a safe place for the separate index and uidlist files? I am
planning to configure Quota/FS. Can they reside under dovecot's
basedir? Is this a good idea?
Dovecot's base_dir is usually under /var/run, which some OSes delete
at boot. So it's not a very good location for it.
Post by Daniel
Does it have any significance where I put those files?
No. Some people use eg. /var/indexes.
If I have the mail_chroot config parameter set to some dir in the config
file and have the home directories set up with /./ ends in the userdb
file, do I have to create the directory which holds the index/uidlist
files under that chroot dir? Now it seems dovecot can not find the
directory which is outside of the chroot (I thought that dovecot opens
the index files before it chroots).

Daniel
Timo Sirainen
2007-03-11 18:39:02 UTC
Permalink
Post by Daniel
If I have the mail_chroot config parameter set to some dir in the config
file and have the home directories set up with /./ ends in the userdb
file, do I have to create the directory which holds the index/uidlist
files under that chroot dir? Now it seems dovecot can not find the
directory which is outside of the chroot (I thought that dovecot opens
the index files before it chroots).
No. Each mailbox has separate index files, so the index files are opened
when the mailbox is opened. So there's no way to have index/control
outside chroot.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20070311/4c02460d/attachment.pgp
Daniel
2007-03-11 19:07:56 UTC
Permalink
Post by Timo Sirainen
Post by Daniel
If I have the mail_chroot config parameter set to some dir in the
config file and have the home directories set up with /./ ends in
the userdb file, do I have to create the directory which holds the
index/uidlist files under that chroot dir? Now it seems dovecot can
not find the directory which is outside of the chroot (I thought
that dovecot opens the index files before it chroots).
No. Each mailbox has separate index files, so the index files are
opened when the mailbox is opened. So there's no way to have
index/control outside chroot.
So is it correct to state that chroot and Quota/FS does not work
simultaneously? The maildirs/mboxes will always be under the chroot
directory, so it is impossible to set the directory containing the
index/uidlist files in a place without quota, if it has to be under the
chroot.

Daniel
Timo Sirainen
2007-03-11 19:12:28 UTC
Permalink
Post by Daniel
Post by Timo Sirainen
No. Each mailbox has separate index files, so the index files are
opened when the mailbox is opened. So there's no way to have
index/control outside chroot.
So is it correct to state that chroot and Quota/FS does not work
simultaneously? The maildirs/mboxes will always be under the chroot
directory, so it is impossible to set the directory containing the
index/uidlist files in a place without quota, if it has to be under the
chroot.
Normally yes. Although it could be possible to do something tricky, such
as temporarily make a mount --bind (assuming you're using Linux) inside
the user's home directory for the index/control files. I'm not sure if
that's a good idea though. :)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20070311/651342d1/attachment.pgp
Daniel
2007-03-11 19:27:29 UTC
Permalink
Post by Timo Sirainen
Post by Daniel
Post by Timo Sirainen
No. Each mailbox has separate index files, so the index files are
opened when the mailbox is opened. So there's no way to have
index/control outside chroot.
So is it correct to state that chroot and Quota/FS does not work
simultaneously? The maildirs/mboxes will always be under the chroot
directory, so it is impossible to set the directory containing the
index/uidlist files in a place without quota, if it has to be under the
chroot.
Normally yes. Although it could be possible to do something tricky,
such as temporarily make a mount --bind (assuming you're using Linux)
inside the user's home directory for the index/control files. I'm not
sure if that's a good idea though. :)
I like that peculiar idea; I would do that just to see if it works!
But fortunatelly I'm running OpenBSD :)
So, I must turn off the mail_chroot option, and also strip the
trailing /./ from the users' homedirs in the userdb file, right?
I know that in the config file you wrote that the chrooting is not
really needed, but if there is a tiny hope, I want to take a chance :)

Daniel
Daniel
2007-03-11 21:25:20 UTC
Permalink
...
[...]

Just one more question: is it wise to copy over the index files and the
dovecot-uidlist files to the new locations, or dovecot will regenerate
them?

Daniel
Timo Sirainen
2007-03-11 21:30:14 UTC
Permalink
Post by Daniel
...
[...]
Just one more question: is it wise to copy over the index files and the
dovecot-uidlist files to the new locations, or dovecot will regenerate
them?
Index files aren't important, but dovecot-uidlist file is important.
Dovecot will regenerate the uidlist too, but it causes the client to
download the messages again because the UIDs changed.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20070311/65b02b1e/attachment.pgp
Daniel
2007-03-11 21:42:28 UTC
Permalink
Post by Timo Sirainen
Post by Daniel
...
[...]
Just one more question: is it wise to copy over the index files and
the dovecot-uidlist files to the new locations, or dovecot will
regenerate them?
Index files aren't important, but dovecot-uidlist file is important.
Dovecot will regenerate the uidlist too, but it causes the client to
download the messages again because the UIDs changed.
And what is exactly the use of the so called Quota reporting plugin? I
mean this (from the bottom of http://wiki.dovecot.org/Quota/FS):
protocol imap {
mail_plugins = quota imap_quota
}

plugin {
quota = fs
}

As far as dovecot concerned, the actual filesystem quota restricts any
file operations, and the smtp server can not deliver messages neither.
So the Maildir is "locked". What could this plugin do?

Daniel
Timo Sirainen
2007-03-11 21:44:43 UTC
Permalink
Post by Daniel
And what is exactly the use of the so called Quota reporting plugin?
It adds IMAP quota commands that can tell the client the current quota
usage and the quota limit.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20070311/6ffa06e3/attachment.pgp
Loading...