Package: dovecot / 1:2.2.13-12~deb8u4

mboxlocking.patch Patch series | download
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
From: Jaldhar H. Vyas <jaldhar@debian.org>
Date: Thu Aug 22 22:44:48 EDT 2013
Subject: policy 22.6 compliant mbox write locking 
Description: 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 efcedc7..2d9b95e 100644
--- a/doc/example-config/conf.d/10-mail.conf
+++ b/doc/example-config/conf.d/10-mail.conf
@@ -276,8 +276,14 @@ namespace inbox {
 # 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 a717b8e..c6c7921 100644
--- a/src/config/all-settings.c
+++ b/src/config/all-settings.c
@@ -829,7 +829,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 019e85a..efe1001 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,