Peter Eriksson
2007-Jul-03 14:20 UTC
[Dovecot] Maildir configuration vs ZFS and snapshots...
I have a little tricky issue around here. First some background: Every user is assigned their own ZFS filesystem, and it's mounted as /home/USER with a Maildir inside it. The there is a filesystem snapshot (read-only) taken automatically every day by the system. The idea is to allow users easy access to backup copies of their mail so that they can restore things themself.. For example this structure (somewhat abbreviated, some files/dirs removed): /home/testson/ .zfs/ snapshot/ 2007-06-18/ Maildir/ cur/ new/ tmp/ .Trash/ cur/ new/ tmp/ Maildir/ cur/ new/ tmp/ .Trash/ cur/ new/ tmp/ Now,I can access the normal Maildir INBOX and folders nicely via Dovecot/IMAP. The thing is I'd like to be able to access the snapshot too via Dovecot/IMAP somehow. My first idea was to use Dovecots namespace feature like this in the config file: namespace private { separator = / prefix = snapshot/ location = maildir:~/.zfs/snapshot/2007-06-18/Maildir:CONTROL=~/.dovecot/control:INDEX=~/.dovecot/index } This works great for the mail folders inside the Maildir - but not for the INBOX which isn't displayed at all... (Ie, under the "snapshot" prefix I only see "Trash" etc when looking at the folder from an IMAP client). I think that I'd need to use the "INBOX=" option for Dovecot to see the top-level "new/cur/tmp" directories in the snapshot folder, but you can only have one INBOX if I'm not mistaken? Any suggestions on how best to configure this? - Peter
Timo Sirainen
2007-Jul-03 15:09 UTC
[Dovecot] Maildir configuration vs ZFS and snapshots...
On Tue, 2007-07-03 at 16:20 +0200, Peter Eriksson wrote:> This works great for the mail folders inside the Maildir - but not > for > the INBOX which isn't displayed at all... (Ie, under the "snapshot" > prefix I only see "Trash" etc when looking at the folder from an IMAP > client).Try "ln -s . .INBOX". I'll probably fix this for v1.1, but I already tried once for v1.0 and it got too messy. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20070703/ede1ac9e/attachment-0002.bin>
Peter Eriksson
2007-Jul-03 15:22 UTC
[Dovecot] Maildir configuration vs ZFS and snapshots...
Timo Sirainen wrote:> On Tue, 2007-07-03 at 16:20 +0200, Peter Eriksson wrote: >> This works great for the mail folders inside the Maildir - but not >> for >> the INBOX which isn't displayed at all... (Ie, under the "snapshot" >> prefix I only see "Trash" etc when looking at the folder from an IMAP >> client). > > Try "ln -s . .INBOX". I'll probably fix this for v1.1, but I already > tried once for v1.0 and it got too messy.It won't confuse Dovecot (and/or external mail programs accessing the Maildir directly like procmail and/or a directly accessing Pine for example)? <resignated *sigh*> Oh how easy this had been if the Maildir standard had been sane and used real directories without dots, in a tree structure for the folder structure (and used .new/, .cur/ and .tmp/ for the folder data) - then I could have just put a pointer to "~/.zfs/snapshot" and have had *all* the snapshots show up under the "snapshot/" namespace more or less automatically :-). </> - Peter
Mike Brudenell
2007-Jul-04 09:25 UTC
[Dovecot] Maildir configuration vs ZFS and snapshots...
Greetings - I'm intrigued by your suggestion of providing read-only access to mail folders in the snapshots... On 3 Jul 2007, at 15:20, Peter Eriksson wrote:> Now,I can access the normal Maildir INBOX and folders nicely via > Dovecot/IMAP. The thing is I'd like to be able to access the > snapshot too via Dovecot/IMAP somehow. My first idea was to use > Dovecots namespace feature like this in the config file: > > namespace private { > separator = / > prefix = snapshot/ > location = maildir:~/.zfs/snapshot/2007-06-18/ > Maildir:CONTROL=~/.dovecot/control:INDEX=~/.dovecot/index > } > > This works great for the mail folders inside the Maildir - but not > for the INBOX which isn't displayed at all... (Ie, under the > "snapshot" prefix I only see "Trash" etc when looking at the folder > from an IMAP client).We are switching from the UW IMAP server with local disks to Dovecot using a NetApp filer. The filer provides snapshots too, although with a slightly different layout as the ".snapshot" directory appears in each and every directory with its files and folders. For example: ~/Maildir/.snapshot/nightly.0/... ~/Maildir/.snapshot/nightly.1/... ~/Maildir/.snapshot/nightly.2/... etc where the ".0" suffixed directory is the most recent etc. In your example your snapshots seem to be in directories named after a specific date (when the snapshot was taken?). I was wondering if you had some clever way of providing access to these; in your example above you hard-code the names into the Dovecot configuration file, which doesn't seem practical for a live system? Basically I'm trying to mimic your setup and was wondering if you had already solved the problem of getting down from your "snapshot" directory through the intermediate level to the Maildir itself. In passing, would I need to use a separate CONTROL and INDEX storage area for these, or will the files for the snapshot folders live happily alongside those for the live area? (I'm not too sure how the organisation of these storage areas works when namespaces and prefixes are concerned!) Cheers, Mike B-) -- The Computing Service, University of York, Heslington, York Yo10 5DD, UK Tel:+44-1904-433811 FAX:+44-1904-433740 * Unsolicited commercial e-mail is NOT welcome at this e-mail address. *