err on the side of caution and make "index_mmap_invalidate = yes" the

default to totally negate the chance of index corruption at the cost of
performance.  ok naddy@
This commit is contained in:
jolan 2003-08-30 00:11:31 +00:00
parent ecdc1c8d34
commit 91933d365c
3 changed files with 19 additions and 20 deletions

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-dovecot-example_conf,v 1.2 2003/07/23 06:03:01 jolan Exp $
--- dovecot-example.conf.orig Thu Jun 26 11:11:06 2003
+++ dovecot-example.conf Tue Jul 15 15:42:11 2003
$OpenBSD: patch-dovecot-example_conf,v 1.3 2003/08/30 00:11:31 jolan Exp $
--- dovecot-example.conf.orig 2003-06-26 11:11:06.000000000 -0500
+++ dovecot-example.conf 2003-08-28 20:20:17.000000000 -0500
@@ -1,13 +1,12 @@
## Dovecot 1.0 configuration file
@ -85,19 +85,20 @@ $OpenBSD: patch-dovecot-example_conf,v 1.2 2003/07/23 06:03:01 jolan Exp $
#mail_read_mmaped = no
# Copy mail to another folders using hard links. This is much faster than
@@ -267,6 +268,11 @@ login = pop3
@@ -267,6 +268,12 @@ login = pop3
# If you care about performance, enable it.
#maildir_copy_with_hardlinks = no
+# Call mmap() with MS_INVALIDATE flag each time before accessing message
+# indexes. This is currently required with OpenBSD 3.3 and older versions.
+# indexes. This option is recommended on OpenBSD 3.4 and older versions
+# to negate the risk of corruption when rebuilding indexes.
+# It's also required if you insist on saving index files over NFS.
+#index_mmap_invalidate = no
+index_mmap_invalidate = yes
+
# Check if mails' content has been changed by external programs. This slows
# down things as extra stat() needs to be called for each file. If changes are
# noticed, the message is treated as a new message, since IMAP protocol
@@ -284,7 +290,7 @@ login = pop3
@@ -284,7 +291,7 @@ login = pop3
# with is important to avoid deadlocks if other MTAs/MUAs are using both fcntl
# and flock. Some operating systems don't allow using both of them
# simultaneously, eg. BSDs. If dotlock is used, it's always created first.
@ -106,7 +107,7 @@ $OpenBSD: patch-dovecot-example_conf,v 1.2 2003/07/23 06:03:01 jolan Exp $
# Should we create dotlock file even when we want only a read-lock? Setting
# this to yes hurts the performance when the mailbox is accessed simultaneously
@@ -314,7 +320,7 @@ login = pop3
@@ -314,7 +321,7 @@ login = pop3
##
# Executable location
@ -115,7 +116,7 @@ $OpenBSD: patch-dovecot-example_conf,v 1.2 2003/07/23 06:03:01 jolan Exp $
# Set max. process size in megabytes. Most of the memory goes to mmap()ing
# files, so it shouldn't harm much even if this limit is set pretty high.
@@ -322,14 +328,14 @@ login = pop3
@@ -322,14 +329,14 @@ login = pop3
# Support for dynamically loadable modules.
#imap_use_modules = no
@ -132,7 +133,7 @@ $OpenBSD: patch-dovecot-example_conf,v 1.2 2003/07/23 06:03:01 jolan Exp $
# Set max. process size in megabytes. Most of the memory goes to mmap()ing
# files, so it shouldn't harm much even if this limit is set pretty high.
@@ -337,7 +343,7 @@ login = pop3
@@ -337,7 +344,7 @@ login = pop3
# Support for dynamically loadable modules.
#pop3_use_modules = no
@ -141,7 +142,7 @@ $OpenBSD: patch-dovecot-example_conf,v 1.2 2003/07/23 06:03:01 jolan Exp $
##
## Authentication processes
@@ -386,10 +392,10 @@ auth_userdb = passwd
@@ -386,10 +393,10 @@ auth_userdb = passwd
# vpopmail: vpopmail authentication
# ldap <config path>: LDAP, see doc/dovecot-ldap.conf
# pgsql <config path>: a PostgreSQL database, see doc/dovecot-pgsql.conf

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-src_imap_main_c,v 1.1 2003/07/23 06:03:01 jolan Exp $
--- src/imap/main.c.orig Mon May 26 10:27:13 2003
+++ src/imap/main.c Tue Jul 15 15:17:22 2003
$OpenBSD: patch-src_imap_main_c,v 1.2 2003/08/30 00:11:31 jolan Exp $
--- src/imap/main.c.orig 2003-05-26 10:27:13.000000000 -0500
+++ src/imap/main.c 2003-08-28 20:15:40.000000000 -0500
@@ -21,6 +21,7 @@
struct ioloop *ioloop;
@ -9,13 +9,13 @@ $OpenBSD: patch-src_imap_main_c,v 1.1 2003/07/23 06:03:01 jolan Exp $
static struct module *modules;
static char log_prefix[128]; /* syslog() needs this to be permanent */
@@ -129,6 +130,9 @@ static void main_init(void)
str = getenv("MAILBOX_CHECK_INTERVAL");
@@ -130,6 +131,9 @@ static void main_init(void)
mailbox_check_interval = str == NULL ? 0 :
(unsigned int)strtoul(str, NULL, 10);
+
+ mailbox_open_flags = getenv("MMAP_INVALIDATE") != NULL ?
+ MAILBOX_OPEN_MMAP_INVALIDATE : 0;
+
client = client_create(hin, hout, storage);
o_stream_cork(client->output);

View File

@ -4,5 +4,3 @@ several coding techniques to avoid most of the common pitfalls. Dovecot
can work with standard mbox and maildir formats and it's fully
compatible with UW-IMAP and Courier IMAP servers as well as mail clients
accessing the mailboxes directly.
WWW: ${HOMEPAGE}