0c53ce6cb7afde3ddee2b3f8eb297ab2c7b03482 |
|
01-Mar-2018 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
LAYOUT=index: Don't mkdir index root directory at init
It's not really needed, since anything that needs it will automatically
mkdir it later as well. This also breaks using LAYOUT=index with mbox,
because the mbox code hasn't yet had a chance to override the index root
path so it was mkdired without the .imap/ suffix. |
bfaf911d4e0003f2679b1f5d36fd2f2674989ff8 |
|
01-Mar-2018 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
LAYOUT=index: Don't prevent using internal mailbox names
For example with Maildir it wasn't possible to create mailboxes named "new",
"cur" or "tmp". |
43ce61b1d755832186f12b9739d18212b4744d14 |
|
24-Jan-2018 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
lib-storage: Add and use INDEX_LIST_CONTEXT_REQUIRE
Satisfies static analyzers |
bcb4e51a409d94ae670de96afb8483a4f7855294 |
|
01-Jan-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
Updated copyright notices to include the year 2018. |
a8200366c303c9dd752303b094ef9a48fe7855df |
|
13-Dec-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
LAYOUT=index: Fix crash in doveadm force-resync if storage doesn't implement list_index_rebuild()
Broken by recent changes. |
f5447068410d91377dad69e5393553015032ef6f |
|
13-Dec-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
LAYOUT=index: Fix updating STATUS changes in mailbox list index
Mailbox list index backend code was overriding sync_init and sync_deinit
methods, which STATUS handling had already already overridden. They both
used the same super struct, so STATUS's sync_* were never called. |
d4002fe1f64d25a792f76fb102ef7dc519cd4e24 |
|
11-Dec-2017 |
Martti Rannanjärvi <martti.rannanjarvi@dovecot.fi> |
global: Use mail_set_critical() and mailbox_set_critical() if possible
Replace calls to mail_storage_set_critical() with mail_set_critical()
or mailbox_set_critical() in places where mailbox or mail are easily
available. |
b42817ce16a8660cbcc4adfc8bccc3db1c6d00c7 |
|
05-Dec-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-storage: Rebuild list index when doing doveadm force-resync |
8528048c7b82c745bcfa5a6b1394251b3aaeb129 |
|
15-Nov-2017 |
Josef 'Jeff' Sipek <jeff.sipek@dovecot.fi> |
lib-storage: Fix MAILBOX_LIST_INDEX_HIERARHCY_SEP spelling
Original work by @jsoref |
19557f192d37cd54a1a090a8a26d9d47265e4413 |
|
01-Nov-2017 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
global: Fix spelling mistakes in comments
Original work by @andreasschulze and @jsoref |
1d9053f57383a2382c70f76b0790a7bf192aa891 |
|
27-Sep-2017 |
Sergey Kitov <sergey.kitov@open-xchange.com> |
global: remove unnecessary ENOENT checks from unlink_directory() calls |
49c48631cfd07017d5f93d83713fffe4f13730c4 |
|
24-Jul-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-storage: Allow LISTINDEX to point to a different directory
Most importantly because the mailbox list index is only a cache, it could be
safely pointed to e.g. tmpfs to save disk I/O. |
0c9a1055469225bce4c309c5ad7c30531e1c0001 |
|
20-Jul-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-storage: Add UIDVALIDITY to mailbox list index on mailbox create
This avoids an unnecessary secondary write later on when opening the
mailbox. |
a384b1fccb51884e8afe0f571420961851a2149d |
|
19-May-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-storage: Explicitly name function pointers in mailbox lists
This allows adding more fields to struct mailbox_list_vfuncs without
compiler warnings. |
d4847b921058734e0668bc7690465c91523d9ec0 |
|
23-Mar-2017 |
Martti Rannanjärvi <martti.rannanjarvi@dovecot.fi> |
global: Log mailbox_list internal errors |
58289301ce9f6aa7121891e33ef7e0a1b4559e8d |
|
14-Feb-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-storage: Fix mailbox list index hook usage
The previous method appeared to work, but not if the internal hooks were
used more than once. |
2454dfa32c93c20a8522c6ed42fe057baaac9f9a |
|
01-Jan-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
Updated copyright notices to include the year 2017. |
efe78d3ba24fc866af1c79b9223dc0809ba26cad |
|
24-Dec-2016 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
global: Replaced all instances of memset(p, 0, sizeof(*p)) with the new i_zero() macro.
Used the following script:
C_FILES=`git ls-files *.c`
H_FILES=`git ls-files *.h`
for F in "$C_FILES $H_FILES"; do
echo "$F"
perl -p -i -e 's/safe_memset\(&\(?([^,]*)\)?,\s*0,\s*sizeof\(\g1\)\)/i_zero_safe(&$1)/g' $F
perl -p -i -e 's/safe_memset\(([^,]*),\s*0,\s*sizeof\(\*\g1\)\)/i_zero_safe($1)/g' $F
perl -p -i -e 's/memset\(&\(?([^,]*)\)?,\s*0,\s*sizeof\(\g1\)\)/i_zero(&$1)/g' $F
perl -p -i -e 's/memset\(([^,]*),\s*0,\s*sizeof\(\*\g1\)\)/i_zero($1)/g' $F
done |
2ac5f36aa7c2e7a07ba8815d43a6d7483f62e74c |
|
16-Dec-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
global: Change string position/length from unsigned int to size_t
Mainly to avoid truncating >4GB strings, which might potentially cause
some security holes. Normally there are other limits, which prevent such
excessive strings from being created in the first place.
I'm sure this didn't find everything. Maybe everything could be found with
compiler warnings. -Wconversion kind of does it, but it gives way too many
unnecessary warnings.
These were mainly found with:
grep " = strlen"
egrep "unsigned int.*(size|len)" |
9a8217a728581b4787ab65eb6d1b06681945803d |
|
14-Dec-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-storage: Fix crash in obox's dsync-merge |
55c88023635062105849a2cbab78232f483b2c02 |
|
24-Nov-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-storage: Try harder to rename a corrupted mailbox name to its old name.
If the old name exists, use it as a prefix for the new name. This is
especially useful when restoring autocreated mailboxes. A new mailbox
could have already been autocreated, but it's still useful to have
the broken one renamed with the same prefix, so it'll be clear that
these mailboxes should be merged. |
0f242c946b153907d2e34bc9993942e6ca277bf8 |
|
16-Nov-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-storage: Fix compiler warnings about enum mismatches |
83d0c8152f694ae5b5d1798abda5728dc886102a |
|
16-Nov-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
LAYOUT=index: Try to rename corrupted mailbox name during mailbox open. |
540555c5b435203e1c26c8e7b924b2643ae07ae3 |
|
16-Nov-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-storage: Added struct mailbox.corrupted_mailbox_name
This allows backends that are adding lost mailboxes to mailbox list index to
indicate that they don't actually know the name of the mailbox, and the
mailbox list index should try to figure it out and rename the mailbox to its
proper name. |
85cbe5d66e22bc1290a33902fa2638245450a2df |
|
16-Nov-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
LAYOUT=index: Don't write corrupted mailbox names to box-name header.
This way when opening a mailbox the box-name header isn't overwritten by
a corrupted name.
Keep track of the corrupted names with MAILBOX_LIST_INDEX_FLAG_CORRUPTED_NAME
flag in list index records. The flag isn't removed until the mailbox is
renamed. |
97a5e150cacf7da9dd200e317b75460352038d65 |
|
16-Nov-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
LAYOUT=index: Update mailbox name to mailbox index's header when opening.
This way if the mailbox list index gets lost, a recent mailbox name is still
available. |
606e388022ed2c9e94f912a5205626d11a9da6dc |
|
16-Nov-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-storage: Prevent renaming mailbox under itself.
This resulted earlier in a loop, which broke the mailbox index.
Note that IMAP already prevented this, so it could only be triggered by
other tools, like doveadm. |
97e511960951550338d69cac98fb5f3ca2badb09 |
|
23-Aug-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Changed unlink_directory() API to return error string.
There are many different reasons why it could fail, which a simple errno
can't very clearly indicate. |
395aa4fe4639d13f37a470409d879f1c2b11254a |
|
01-Jul-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
LAYOUT=index: Make sure error is preserved if created mailbox can't be added to list index.
mailbox_delete() could overwrite the error. |
291ce16fffca75e8598a8c9dceb08613413dcb07 |
|
19-Apr-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-storage: Added MAIL_STORAGE_CLASS_FLAG_NO_LIST_DELETES and MAILBOX_LIST_FLAG_NO_DELETES |
02c335c23bf5fa225a467c19f2c063fb0dc7b8c3 |
|
12-Jan-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
global: freshen copyright
git ls-files | xargs perl -p -i -e 's/(\d+)-201[0-5]/$1-2016/g;s/ (201[0-5]) Dovecot/ $1-2016 Dovecot/' |
453278403dbd2083b0c9a7aa5edb68d3f82ad4f6 |
|
21-Oct-2015 |
Timo Sirainen <tss@iki.fi> |
LAYOUT=index: Fixed error handling in mailbox creation race condition.
If two processes create the same mailbox, the other one ends up being
deleted on failure. However, if the deletion itself also failed the state
becomes a big ambiguous. We don't want to return MAIL_ERROR_EXISTS in that
case, because the caller may try to open the mailbox with the inconsistent
state and fail. So we'll instead return the original mailbox_delete() error
to the caller. |
e048e63fec8d21d4af0fd9d27dd3fe5dcedf18e6 |
|
10-Jul-2015 |
Timo Sirainen <tss@iki.fi> |
lib-storage: If mailboxes' vsizes are used, keep them updated also in mailbox list index.
This allows looking them up quickly without opening the actual mailbox
indexes. |
8d56694af13780c2b9b94bc1534ca9d03be19f29 |
|
20-Feb-2015 |
Timo Sirainen <tss@iki.fi> |
LAYOUT=index: Reversed d977a746819d - use storage's list_index_*() callbacks after all.
Just because we have all the mailbox information in the mailbox list index
doesn't mean that we necessarily trust the folder mail counts and such to be
correct. Setting mailbox_list_index_very_dirty_syncs=yes pretty much reverts
to the earlier behavior. |
7cb128dc4cae2a03a742f63ba7afee23c78e3af0 |
|
05-Jan-2015 |
Phil Carmody <phil@dovecot.fi> |
global: freshen copyright
Robomatically:
git ls-files | xargs perl -p -i -e 's/(\d+)-201[0-4]/$1-2015/g;s/ (201[0-4]) Dovecot/ $1-2015 Dovecot/'
Happy 2015 everyone!
Signed-off-by: Phil Carmody <phil@dovecot.fi> |
34b858a4586db070d899e128a6fc76a4ea6050be |
|
27-Oct-2014 |
Timo Sirainen <tss@iki.fi> |
lib-storage: Recent change broke deleting mailboxes with LAYOUT=index |
bb2471ff14f01390b47cce63b407820b5547df1a |
|
25-Oct-2014 |
Timo Sirainen <tss@iki.fi> |
lib-storage: LAYOUT=index now first creates the backend mailbox and only then adds it to list index.
This avoids any race conditions with mailbox creation and opening it. |
3a177dbf62af83209f1e33fc28c620ea1fc14ada |
|
21-Oct-2014 |
Timo Sirainen <tss@iki.fi> |
lib-storage: LAYOUT=index no longer keeps list index locked while creating mailbox.
Mailbox opening can be slow and complicated and could even try to lock the
list index again. So it's a bit more racy now, but all mailbox formats can
already handle races with mailbox creation. |
330865e1eb92715b34462af25c90c7308624c2af |
|
21-Oct-2014 |
Timo Sirainen <tss@iki.fi> |
lib-storage: Partially reverted previous change. Added mailbox_list_index_sync_delete() instead. |
c44f7761bba61503d573eb950b9377f9d55ce2aa |
|
21-Oct-2014 |
Timo Sirainen <tss@iki.fi> |
lib-storage: Added mailbox_list_index_delete_entry() |
f3391d65cc830eab22ca6c5941774de682716edb |
|
16-Oct-2014 |
Timo Sirainen <tss@iki.fi> |
lib-storage: LAYOUT=index doesn't reserve '~' as internal separator anymore.
The index doesn't reserve any character as hierarchy separator, so the
internal separator can change at any time. Use the namespace's configured
hierarchy separator as the internal separator to avoid reserving any
characters. If namespace separator isn't configured, fallback to the
original '~' so this change shouldn't break anything. |
b056d19b7a07400b897104b146c8768280d24009 |
|
08-Oct-2014 |
Timo Sirainen <tss@iki.fi> |
lib-storage: LAYOUT=index small code cleanup |
28f7485aaa7c5e0e3aa85d5a65d0dfc1c7ec7b89 |
|
08-Oct-2014 |
Timo Sirainen <tss@iki.fi> |
lib-storage: Fixed earlier LAYOUT=index change to refresh index before opening a view to it.
Fixes an assert-crash. |
f663bdd9d345a86e6a7924d83319bd04b2fcb600 |
|
07-Oct-2014 |
Timo Sirainen <tss@iki.fi> |
lib-storage: Fixed some race condition crashes with LAYOUT=index |
7da0a157dbcb64d3e97c01bcc87262bd944c6890 |
|
08-May-2014 |
Timo Sirainen <tss@iki.fi> |
lib-storage: Removed unnecessary code.
mailbox_dir_name is never NULL, and when it's empty it can be handled
exactly the same as when it's non-empty. |
a8c5a86d183db25a57bf193c06b41e092ec2e151 |
|
04-Feb-2014 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2014. |
58840b6cfccd09f0a7c6cd206437e52b6d8d386e |
|
19-Nov-2013 |
Timo Sirainen <tss@iki.fi> |
lib-storage: Error handling fix for layout=index when mailbox creation fails. |
ca31fc1a8e48281c6882796fa7d4372acc2f97e5 |
|
11-Oct-2013 |
Timo Sirainen <tss@iki.fi> |
LAYOUT=index: Fixed race condition during mailbox creation. |
3568ea090b5a072e498438e74db23b98103ff2de |
|
12-Jun-2013 |
Timo Sirainen <tss@iki.fi> |
lib-storage: Don't crash if backend doesn't have subscriptions file. |
90a2c5f48c5f88f07bbf0477e3023d2099252b92 |
|
18-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
layout=index: Fixed listing subscriptions. |
dfc96c43be0720d3a03faa1eb44032276cbf94cf |
|
04-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
layout=index: Don't crash on mailbox_update() if the mailbox path couldn't be found. |
d71d05cf4417eaedb4d72491480a7d2bb46d8df3 |
|
20-Mar-2013 |
Timo Sirainen <tss@iki.fi> |
layout=index: Fixed mailbox_exists() |
bdf6608a8215bcb8e50ced222616b6baa69e954d |
|
20-Mar-2013 |
Timo Sirainen <tss@iki.fi> |
layout=index: Don't return a path for \Noselect mailboxes. |
68b968ad67513632a02aa0f8f81679fe072ca3c0 |
|
19-Feb-2013 |
Timo Sirainen <tss@iki.fi> |
LAYOUT=index: Index is the only source for mailbox info, don't try any syncing with storage. |
3a2f2adf5679aa383a2cab09f739d59233cada95 |
|
19-Feb-2013 |
Timo Sirainen <tss@iki.fi> |
lib-storage: Fixed mailbox_update() when using mailbox_list_index=yes |
5a580c3a38ced62d4bcc95b8ac7c4f2935b5d294 |
|
02-Feb-2013 |
Timo Sirainen <tss@iki.fi> |
Oops :) Update copyrights to 2013 without breaking all .c files. |
cca4ba2a504d70a9fe9fee37f8433997359de52c |
|
02-Feb-2013 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2013. |
201437e07fd40d296377cc20ed1dab1f2777544a |
|
08-Dec-2012 |
Timo Sirainen <tss@iki.fi> |
layout=index: If MAILBOX_LIST_FLAG_NO_MAIL_FILES is set, don't try to delete any mail files. |
29543188462c9348f365ec29115d777ffe4769d3 |
|
26-Nov-2012 |
Timo Sirainen <tss@iki.fi> |
lib-storage: Fixes to LAYOUT=index backend. |
31159b598c4188211ff8f292daad1d23ee5db3cb |
|
29-Oct-2012 |
Timo Sirainen <tss@iki.fi> |
layout=index: Fixed a crash in mailbox_rename() race condition. |
917498e6f84969d2b93410c1e479735abe8e0ed7 |
|
12-Oct-2012 |
Timo Sirainen <tss@iki.fi> |
lib-storage: Added optional mailbox_list.init(), which can check for failure.
"index" backend now gives a nice error message instead of crashing when
mailbox_list_index=no |
e0aff4c7e3336ec4b5edbcfc3a72e1e118603ee2 |
|
27-Sep-2012 |
Timo Sirainen <tss@iki.fi> |
lib-storage: Added initial implementation for layout=index.
The idea is that all of the mailbox names only exist in the mailbox list
index. Storage directories use mailbox GUIDs. This avoids all kinds of
race conditions with mailbox renames. mailbox_list_index=yes is required for
this layout to work.
There are probably still some race conditions within the indexing code
itself. Also error recovery is missing. |