From 0aa08b74135fe2456a0b5fe2f39a9e6080ac95c3 Mon Sep 17 00:00:00 2001 From: link2xt Date: Fri, 17 Apr 2026 18:52:53 +0200 Subject: [PATCH] feat(dovecot): disable fsync for LMTP and IMAP services This is aimed at reducing SSD wear level. SSDs wear out because of writes according to , so anything reducing the writes should be helpful. For online users Maildir format that we use results in first storing the message in new/ and then moving to cur/ and then maybe even deleting it immediately for users with a single device or bots. Syncing all these changes to disk is unnecessary and wears SSDs. --- cmdeploy/src/cmdeploy/dovecot/dovecot.conf.j2 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmdeploy/src/cmdeploy/dovecot/dovecot.conf.j2 b/cmdeploy/src/cmdeploy/dovecot/dovecot.conf.j2 index 9e5d452a..bd1ce053 100644 --- a/cmdeploy/src/cmdeploy/dovecot/dovecot.conf.j2 +++ b/cmdeploy/src/cmdeploy/dovecot/dovecot.conf.j2 @@ -133,6 +133,11 @@ protocol lmtp { # mail_lua and push_notification_lua are needed for Lua push notification handler. # mail_plugins = $mail_plugins mail_lua notify push_notification push_notification_lua + + # Disable fsync for LMTP. May lose delivered message, + # but unlikely to cause problems with multiple relays. + # https://doc.dovecot.org/2.3/admin_manual/mailbox_formats/#fsyncing + mail_fsync = never } plugin { @@ -252,6 +257,9 @@ protocol imap { # sort -sn <(sed 's/ / C: /' *.in) <(sed 's/ / S: /' cat *.out) rawlog_dir = %h + + # Disable fsync for IMAP. May lose IMAP changes like setting flags. + mail_fsync = never } {% endif %}