# HG changeset patch # User Timo Sirainen # Date 1184275104 -10800 # Node ID 38a73d870731c09dc41719372d78ee916d0ed9b7 # Parent 3a19830ab7f6f7873c93e521b75100f63f7ccda3 Added mail_nfs_storage and mail_nfs_index settings. diff -r 3a19830ab7f6 -r 38a73d870731 dovecot-example.conf --- a/dovecot-example.conf Fri Jul 13 00:15:56 2007 +0300 +++ b/dovecot-example.conf Fri Jul 13 00:18:24 2007 +0300 @@ -303,6 +303,13 @@ # goes down. #fsync_disable = no +# Mail storage exists in NFS. Set this to yes to make Dovecot flush NFS caches +# whenever needed. If you're using only a single mail server this isn't needed. +#mail_nfs_storage = no +# Mail index files also exist in NFS. Setting this to yes requires +# mmap_disable=yes and fsync_disable=no. +#mail_nfs_index = no + # Disable mailbox list indexing. #mailbox_list_index_disable = no diff -r 3a19830ab7f6 -r 38a73d870731 src/lib-storage/mail-storage.c --- a/src/lib-storage/mail-storage.c Fri Jul 13 00:15:56 2007 +0300 +++ b/src/lib-storage/mail-storage.c Fri Jul 13 00:18:24 2007 +0300 @@ -86,6 +86,15 @@ *flags_r |= MAIL_STORAGE_FLAG_SAVE_CRLF; if (getenv("FSYNC_DISABLE") != NULL) *flags_r |= MAIL_STORAGE_FLAG_FSYNC_DISABLE; + if (getenv("MAIL_NFS_STORAGE") != NULL) + *flags_r |= MAIL_STORAGE_FLAG_NFS_FLUSH_STORAGE; + if (getenv("MAIL_NFS_INDEX") != NULL) { + *flags_r |= MAIL_STORAGE_FLAG_NFS_FLUSH_INDEX; + if ((*flags_r & MAIL_STORAGE_FLAG_MMAP_DISABLE) == 0) + i_fatal("mail_nfs_index=yes requires mmap_disable=yes"); + if ((*flags_r & MAIL_STORAGE_FLAG_FSYNC_DISABLE) != 0) + i_fatal("mail_nfs_index=yes requires fsync_disable=no"); + } str = getenv("POP3_UIDL_FORMAT"); if (str != NULL && (str = strchr(str, '%')) != NULL && diff -r 3a19830ab7f6 -r 38a73d870731 src/master/mail-process.c --- a/src/master/mail-process.c Fri Jul 13 00:15:56 2007 +0300 +++ b/src/master/mail-process.c Fri Jul 13 00:18:24 2007 +0300 @@ -334,6 +334,10 @@ env_put("DOTLOCK_USE_EXCL=1"); if (set->fsync_disable) env_put("FSYNC_DISABLE=1"); + if (set->mail_nfs_storage) + env_put("MAIL_NFS_STORAGE=1"); + if (set->mail_nfs_index) + env_put("MAIL_NFS_INDEX=1"); if (set->mailbox_list_index_disable) env_put("MAILBOX_LIST_INDEX_DISABLE=1"); if (set->maildir_stat_dirs) diff -r 3a19830ab7f6 -r 38a73d870731 src/master/master-settings-defs.c --- a/src/master/master-settings-defs.c Fri Jul 13 00:15:56 2007 +0300 +++ b/src/master/master-settings-defs.c Fri Jul 13 00:18:24 2007 +0300 @@ -79,6 +79,8 @@ DEF_BOOL(mmap_disable), DEF_BOOL(dotlock_use_excl), DEF_BOOL(fsync_disable), + DEF_BOOL(mail_nfs_storage), + DEF_BOOL(mail_nfs_index), DEF_BOOL(mailbox_list_index_disable), DEF_STR(lock_method), DEF_BOOL(maildir_stat_dirs), diff -r 3a19830ab7f6 -r 38a73d870731 src/master/master-settings.c --- a/src/master/master-settings.c Fri Jul 13 00:15:56 2007 +0300 +++ b/src/master/master-settings.c Fri Jul 13 00:18:24 2007 +0300 @@ -235,6 +235,8 @@ #endif MEMBER(dotlock_use_excl) FALSE, MEMBER(fsync_disable) FALSE, + MEMBER(mail_nfs_storage) FALSE, + MEMBER(mail_nfs_index) FALSE, MEMBER(mailbox_list_index_disable) FALSE, MEMBER(lock_method) "fcntl", MEMBER(maildir_stat_dirs) FALSE, diff -r 3a19830ab7f6 -r 38a73d870731 src/master/master-settings.h --- a/src/master/master-settings.h Fri Jul 13 00:15:56 2007 +0300 +++ b/src/master/master-settings.h Fri Jul 13 00:18:24 2007 +0300 @@ -91,6 +91,8 @@ bool mmap_disable; bool dotlock_use_excl; bool fsync_disable; + bool mail_nfs_storage; + bool mail_nfs_index; bool mailbox_list_index_disable; const char *lock_method; bool maildir_stat_dirs;