1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
From: "Jaldhar H. Vyas" <jaldhar@debian.org>
Date: Thu, 22 Aug 2013 22:44:48 -0400
Subject: policy 22.6 compliant mbox write locking
For NFS safety, prefer fcntl to dotlocks.
Dovecots default is the other way around.
Bug: #720502
---
doc/example-config/conf.d/10-mail.conf | 8 +++++++-
src/config/all-settings.c | 2 +-
src/lib-storage/index/mbox/mbox-settings.c | 2 +-
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/doc/example-config/conf.d/10-mail.conf b/doc/example-config/conf.d/10-mail.conf
index a69224f..b47235f 100644
--- a/doc/example-config/conf.d/10-mail.conf
+++ b/doc/example-config/conf.d/10-mail.conf
@@ -320,8 +320,14 @@ protocol !indexer-worker {
# in is important to avoid deadlocks if other MTAs/MUAs are using multiple
# locking methods as well. Some operating systems don't allow using some of
# them simultaneously.
+#
+# The Debian value for mbox_write_locks differs from upstream Dovecot. It is
+# changed to be compliant with Debian Policy (section 11.6) for NFS safety.
+# Dovecot: mbox_write_locks = dotlock fcntl
+# Debian: mbox_write_locks = fcntl dotlock
+#
#mbox_read_locks = fcntl
-#mbox_write_locks = dotlock fcntl
+#mbox_write_locks = fcntl dotlock
# Maximum time to wait for lock (all of them) before aborting.
#mbox_lock_timeout = 5 mins
diff --git a/src/config/all-settings.c b/src/config/all-settings.c
index 391da6d..231100f 100644
--- a/src/config/all-settings.c
+++ b/src/config/all-settings.c
@@ -1239,7 +1239,7 @@ static const struct setting_define mbox_setting_defines[] = {
};
static const struct mbox_settings mbox_default_settings = {
.mbox_read_locks = "fcntl",
- .mbox_write_locks = "dotlock fcntl",
+ .mbox_write_locks = "fcntl dotlock",
.mbox_lock_timeout = 5*60,
.mbox_dotlock_change_timeout = 2*60,
.mbox_min_index_size = 0,
diff --git a/src/lib-storage/index/mbox/mbox-settings.c b/src/lib-storage/index/mbox/mbox-settings.c
index 1df2452..b4eb520 100644
--- a/src/lib-storage/index/mbox/mbox-settings.c
+++ b/src/lib-storage/index/mbox/mbox-settings.c
@@ -27,7 +27,7 @@ static const struct setting_define mbox_setting_defines[] = {
static const struct mbox_settings mbox_default_settings = {
.mbox_read_locks = "fcntl",
- .mbox_write_locks = "dotlock fcntl",
+ .mbox_write_locks = "fcntl dotlock",
.mbox_lock_timeout = 5*60,
.mbox_dotlock_change_timeout = 2*60,
.mbox_min_index_size = 0,
|