Enable Dovecot Lazy Expunge

With a default Dovecot 2.4 installation expunge seems to be included with the Dovecot installation but not activated yet.

This is a quite simple implementation.

The libraries are there by default (lazy expunge is part of the Dovecot core installation):
Code:
find "$(doveconf -h mail_plugin_dir)" -type f | grep -E 'lazy|expunge'
/usr/lib64/dovecot/lib02_lazy_expunge_plugin.a
/usr/lib64/dovecot/lib02_lazy_expunge_plugin.so
/usr/lib64/dovecot/lib02_lazy_expunge_plugin.la

You would need to add this into this config file /etc/dovecot/conf.d/95-lazy-expunge.conf:
Code:
mail_plugins {
  lazy_expunge = yes
}

lazy_expunge_mailbox = .EXPUNGED
lazy_expunge_only_last_instance = yes

namespace inbox {
  mailbox .EXPUNGED {
    autoexpunge = 30days
    autoexpunge_max_mails = 100000
  }
}

mailbox .EXPUNGED {
  quota_ignore = yes
}

After that run:
Code:
systemctl restart dovecot
 
Back
Top