Mercurial > dovecot > original-hg > dovecot-1.2
annotate doc/mail-storages.txt @ 817:86cf24da85f1 HEAD
Added :INDEX=<dir> for both Maildir and mbox to specify different location
where to store index files. This would allow keeping mailboxes accessible
through NFS but still keep the indexes in fast local disk.
Did also some other related cleanups and minor fixes.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 20 Dec 2002 09:53:51 +0200 |
parents | ef64c9a50326 |
children | 2512ad6fd9e9 |
rev | line source |
---|---|
430 | 1 Maildir |
2 ------- | |
429 | 3 |
4 We support Courier-compatible Maildir++. INBOX is the ~/Maildir directory, | |
5 all the other folders named as ".<folder>.<subfolder>.<etc>" under it, any | |
6 directories not starting with a dot are simply ignored. Deleting folders is | |
7 made atomic by renaming them as "..<folder name>" and deleting the | |
8 directory after that. So, all directories beginning with ".." are deleted | |
9 whenever they're noticed. Indexes are stored into each folder's root | |
10 directory. | |
11 | |
12 Custom flags saved using a..z letters as Maildir file flags. .customflags | |
13 file is then used to map the letters to names (a=0, b=1, etc). | |
14 | |
430 | 15 |
16 mbox | |
17 ---- | |
429 | 18 |
815
ef64c9a50326
Support for separate location of mbox INBOX folder.
Timo Sirainen <tss@iki.fi>
parents:
430
diff
changeset
|
19 mbox storage requires an IMAP root directory where to store IMAP folders |
ef64c9a50326
Support for separate location of mbox INBOX folder.
Timo Sirainen <tss@iki.fi>
parents:
430
diff
changeset
|
20 and some other information. mbox file for INBOX is a special case which may |
ef64c9a50326
Support for separate location of mbox INBOX folder.
Timo Sirainen <tss@iki.fi>
parents:
430
diff
changeset
|
21 exist elsewhere in filesystem. |
429 | 22 |
815
ef64c9a50326
Support for separate location of mbox INBOX folder.
Timo Sirainen <tss@iki.fi>
parents:
430
diff
changeset
|
23 All files in the IMAP root directory not beginning with a "." are treated |
ef64c9a50326
Support for separate location of mbox INBOX folder.
Timo Sirainen <tss@iki.fi>
parents:
430
diff
changeset
|
24 as IMAP folders. Directories are treated as being IMAP subfolders. |
ef64c9a50326
Support for separate location of mbox INBOX folder.
Timo Sirainen <tss@iki.fi>
parents:
430
diff
changeset
|
25 |
ef64c9a50326
Support for separate location of mbox INBOX folder.
Timo Sirainen <tss@iki.fi>
parents:
430
diff
changeset
|
26 Dovecot's indexes are stored in ".imap/<mailbox name>/" directories under |
ef64c9a50326
Support for separate location of mbox INBOX folder.
Timo Sirainen <tss@iki.fi>
parents:
430
diff
changeset
|
27 the folder directories. |
ef64c9a50326
Support for separate location of mbox INBOX folder.
Timo Sirainen <tss@iki.fi>
parents:
430
diff
changeset
|
28 |
ef64c9a50326
Support for separate location of mbox INBOX folder.
Timo Sirainen <tss@iki.fi>
parents:
430
diff
changeset
|
29 MAIL environment for mbox is: <root folder>|<INBOX path>[:INBOX=<path>]. |
ef64c9a50326
Support for separate location of mbox INBOX folder.
Timo Sirainen <tss@iki.fi>
parents:
430
diff
changeset
|
30 For example ~/Mail:INBOX=/var/mail/username. |
430 | 31 |
817
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
32 indexes |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
33 ------- |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
34 |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
35 It's possible to specify different location for index files. This could be |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
36 wanted if mailboxes are accessed via remote filesystem (eg. NFS). Indexes |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
37 are mmap()ed and fcntl() locked, so they may not work too well with NFS, or |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
38 at least they'll work a bit slowly. |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
39 |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
40 Indexes don't contain anything really important in them, so it doesn't |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
41 matter if they're lost or are out of sync. Dovecot just rebuilds or |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
42 refreshes them. This would allow creating a cluster where each computer |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
43 keeps the indexes locally while accessing the actual mailboxes via NFS. To |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
44 avoid unnecessarily rebuilding indexes all the time, the users should be |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
45 redirected to their primary server whenever possible. |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
46 |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
47 Currently the only annoying thing with recreating indexes is that the |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
48 message UIDs will change, which may cause more traffic to clients, and |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
49 depending on client software may cause loss of some message-specific |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
50 settings. This will be fixed later by storing the UIDs permanently to |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
51 mailboxes. |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
52 |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
53 Adding :INDEX=<dir> to MAIL environment overrides the default location. The |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
54 given directory must exist. |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
55 |
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
56 |
430 | 57 Detecting what to use |
58 --------------------- | |
429 | 59 |
60 imap process detects the storage from MAIL-environment. It's preferred | |
61 format is "<storage>:<data>", for example "maildir:~/Maildir". It's anyway | |
62 allowed to be in pretty much any format as long as some of the storages | |
63 recognizes it as a valid data, so for example "MAIL=~/mail" is first | |
64 checked by maildir storage to see if it's valid maildir and mbox storage | |
65 after that. | |
66 | |
67 If the MAIL environment isn't given at all, all storages are gone through | |
68 and asked if they can find a usable mail folder. Also as a special case, if | |
69 MAILDIR environment exists, maildir storage is used with the directory | |
70 specified in it. | |
71 | |
72 Maildir storage is autodetected by checking if <directory>/cur/ exists and | |
73 we have rwx access to it. If directory isn't known, / and ~/Maildir are | |
74 checked. / is checked because we could be chrooted. | |
75 | |
815
ef64c9a50326
Support for separate location of mbox INBOX folder.
Timo Sirainen <tss@iki.fi>
parents:
430
diff
changeset
|
76 mbox storage requires detecting INBOX location and IMAP root directory. If |
ef64c9a50326
Support for separate location of mbox INBOX folder.
Timo Sirainen <tss@iki.fi>
parents:
430
diff
changeset
|
77 MAIL environment points to file (+rw) it's treated as the INBOX file. If it |
ef64c9a50326
Support for separate location of mbox INBOX folder.
Timo Sirainen <tss@iki.fi>
parents:
430
diff
changeset
|
78 points to directory (+rwx) which contains .imap/ (+rwx), inbox (+rw) or |
ef64c9a50326
Support for separate location of mbox INBOX folder.
Timo Sirainen <tss@iki.fi>
parents:
430
diff
changeset
|
79 mbox (+rw) it's treated as IMAP root directory. If INBOX isn't known, |
ef64c9a50326
Support for separate location of mbox INBOX folder.
Timo Sirainen <tss@iki.fi>
parents:
430
diff
changeset
|
80 imap_root/inbox file is used by default. If root directory isn't known, we |
ef64c9a50326
Support for separate location of mbox INBOX folder.
Timo Sirainen <tss@iki.fi>
parents:
430
diff
changeset
|
81 try to find it from /, ~/mail or ~/Mail. |
429 | 82 |
430 | 83 |
84 Files created by Dovecot | |
85 ------------------------ | |
429 | 86 |
87 .subscriptions: One folder per line listing subscribed IMAP folders. | |
88 There's only one of these files in the root mail directory (~/Maildir/ or | |
89 ~/mail/.imap/). | |
90 | |
91 Then there's the per-folder files: | |
92 | |
93 .imap.index: Fixed width mail index records. | |
94 | |
95 .imap.index.data: Variable width data, for example mail file name and | |
96 cached body, envelope, etc. | |
97 | |
98 .imap.index.log: Log file describing made changes. This file is used to | |
99 mark external changes (expunges and flag changes) temporarily until they're | |
100 synced into IMAP clients. If multiple Dovecots have the same folder open, | |
101 this can be a big speedup. | |
102 | |
103 .imap.index.tree: Binary tree used for looking up messages from .imap.index | |
104 file. This is used for both UID lookups and message sequence lookups. | |
105 Sequences can be looked up directly from the index as long as no messages | |
106 have been expunged, but after that it gets slow unless it's compressed. | |
107 Using this file however can keep the sequence lookups and expunges fast in | |
108 all situations without requiring compression. | |
109 | |
110 .customflags: Lists custom message flags. First line is header which | |
111 Dovecots check to see if the file has changed. Other lines list the flags | |
112 in format "<flag number> <flag name>". Currently there can be 26 different | |
113 flags (0..25). | |
114 | |
115 .imap.index.log and .imap.index.tree files can be deleted without any data | |
116 loss, they're simply recreated/rebuilt when they're noticed missing. | |
117 | |
118 Deleting .imap.index and .imap.index.data files results in loss of message | |
119 UIDs. That may be a bad thing with some IMAP clients which store some data | |
120 about message locally and identifies the message by it's UID. | |
121 | |
122 Deleting .customflags results in loss of custom flag names for Maildir. | |
123 With mbox the .customflags is simply recreated based on the flags listed | |
124 in the mbox file itself (ie. no data loss). |