From af079a11391f9c3d3150eb5442059870d25e1785 Mon Sep 17 00:00:00 2001 From: KiekerJan Date: Sun, 4 Jul 2021 20:09:29 +0200 Subject: [PATCH] enable compression for dovecot mailboxes --- setup/mail-dovecot.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/setup/mail-dovecot.sh b/setup/mail-dovecot.sh index 26d32895..52bfade8 100755 --- a/setup/mail-dovecot.sh +++ b/setup/mail-dovecot.sh @@ -193,6 +193,33 @@ EOF cp conf/sieve-spam.txt /etc/dovecot/sieve-spam.sieve sievec /etc/dovecot/sieve-spam.sieve +### Compression + +# Create configuration file to enable compression +cat > /etc/dovecot/conf.d/90-plugin-zlib.conf << EOF; +# Enable Zlib for imap +protocol imap { + mail_plugins = $mail_plugins zlib +} +# Enable Zlib for pop3 +protocol pop3 { + mail_plugins = $mail_plugins zlib +} +# Enable Zlib for lmtp +protocol lmtp { + mail_plugins = $mail_plugins zlib +} +# Increase memory allowed for imap as it costs more to read compressed files +service imap { + vsz_limit = 1024MB +} +# Configure the zlib plugin +plugin { + zlib_save_level = 6 + zlib_save = lz4 +} +EOF + # PERMISSIONS # Ensure configuration files are owned by dovecot and not world readable.