Mercurial > dovecot > core-2.2
annotate doc/mail-storages.txt @ 1741:9df02b1533b3 HEAD
Removed most of the license comments from src/lib/*.c. It's just fine to
keep them in a single COPYING.MIT file. Changed a few other comments as well.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 27 Aug 2003 00:18:16 +0300 |
parents | 19ef482ece51 |
children | 1f92f41addea |
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 |
1238
2512ad6fd9e9
Index opening rewrites. We don't try to support .imap.index-<hostname> style
Timo Sirainen <tss@iki.fi>
parents:
817
diff
changeset
|
56 It's also possible to disable index files by building them into memory. |
2512ad6fd9e9
Index opening rewrites. We don't try to support .imap.index-<hostname> style
Timo Sirainen <tss@iki.fi>
parents:
817
diff
changeset
|
57 They're also automatically built into memory if the index files can't be |
2512ad6fd9e9
Index opening rewrites. We don't try to support .imap.index-<hostname> style
Timo Sirainen <tss@iki.fi>
parents:
817
diff
changeset
|
58 opened or created for some reason (eg. out of disk space). To disable |
2512ad6fd9e9
Index opening rewrites. We don't try to support .imap.index-<hostname> style
Timo Sirainen <tss@iki.fi>
parents:
817
diff
changeset
|
59 indexes always, add :INDEX=MEMORY to MAIL environment. |
2512ad6fd9e9
Index opening rewrites. We don't try to support .imap.index-<hostname> style
Timo Sirainen <tss@iki.fi>
parents:
817
diff
changeset
|
60 |
817
86cf24da85f1
Added :INDEX=<dir> for both Maildir and mbox to specify different location
Timo Sirainen <tss@iki.fi>
parents:
815
diff
changeset
|
61 |
430 | 62 Detecting what to use |
63 --------------------- | |
429 | 64 |
65 imap process detects the storage from MAIL-environment. It's preferred | |
66 format is "<storage>:<data>", for example "maildir:~/Maildir". It's anyway | |
67 allowed to be in pretty much any format as long as some of the storages | |
68 recognizes it as a valid data, so for example "MAIL=~/mail" is first | |
69 checked by maildir storage to see if it's valid maildir and mbox storage | |
70 after that. | |
71 | |
72 If the MAIL environment isn't given at all, all storages are gone through | |
73 and asked if they can find a usable mail folder. Also as a special case, if | |
74 MAILDIR environment exists, maildir storage is used with the directory | |
75 specified in it. | |
76 | |
77 Maildir storage is autodetected by checking if <directory>/cur/ exists and | |
78 we have rwx access to it. If directory isn't known, / and ~/Maildir are | |
79 checked. / is checked because we could be chrooted. | |
80 | |
815
ef64c9a50326
Support for separate location of mbox INBOX folder.
Timo Sirainen <tss@iki.fi>
parents:
430
diff
changeset
|
81 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
|
82 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
|
83 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
|
84 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
|
85 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
|
86 try to find it from /, ~/mail or ~/Mail. |
429 | 87 |
430 | 88 |
89 Files created by Dovecot | |
90 ------------------------ | |
429 | 91 |
92 .subscriptions: One folder per line listing subscribed IMAP folders. | |
93 There's only one of these files in the root mail directory (~/Maildir/ or | |
94 ~/mail/.imap/). | |
95 | |
96 Then there's the per-folder files: | |
97 | |
98 .imap.index: Fixed width mail index records. | |
99 | |
100 .imap.index.data: Variable width data, for example mail file name and | |
101 cached body, envelope, etc. | |
102 | |
103 .imap.index.log: Log file describing made changes. This file is used to | |
104 mark external changes (expunges and flag changes) temporarily until they're | |
105 synced into IMAP clients. If multiple Dovecots have the same folder open, | |
106 this can be a big speedup. | |
107 | |
108 .imap.index.tree: Binary tree used for looking up messages from .imap.index | |
109 file. This is used for both UID lookups and message sequence lookups. | |
110 Sequences can be looked up directly from the index as long as no messages | |
111 have been expunged, but after that it gets slow unless it's compressed. | |
112 Using this file however can keep the sequence lookups and expunges fast in | |
113 all situations without requiring compression. | |
114 | |
115 .customflags: Lists custom message flags. First line is header which | |
116 Dovecots check to see if the file has changed. Other lines list the flags | |
117 in format "<flag number> <flag name>". Currently there can be 26 different | |
118 flags (0..25). | |
119 | |
1593
19ef482ece51
We don't lose UIDs anymore if index is deleted.
Timo Sirainen <tss@iki.fi>
parents:
1238
diff
changeset
|
120 .imap.index* files can be deleted without any data loss, they're simply |
19ef482ece51
We don't lose UIDs anymore if index is deleted.
Timo Sirainen <tss@iki.fi>
parents:
1238
diff
changeset
|
121 recreated/rebuilt when they're noticed missing. |
429 | 122 |
123 Deleting .customflags results in loss of custom flag names for Maildir. | |
124 With mbox the .customflags is simply recreated based on the flags listed | |
125 in the mbox file itself (ie. no data loss). |