Safely reclaim disk space on Dovecot Maildir servers by analyzing and transparently compressing old email.
curl -sL https://github.com/nemke82/mailshrink/releases/latest/download/mailshrink-linux-amd64 -o /usr/local/bin/mailshrink && chmod +x /usr/local/bin/mailshrink
Scan your server and see exactly how much space is reclaimable — measured from real samples, not guesswork.
Dry-run mode, Dovecot zlib verification, atomic operations, and metadata preservation. Nothing is modified until you say so.
Single static binary. Download, chmod, run. Works on Ubuntu, AlmaLinux, Rocky, Debian — any Linux with Dovecot.
mailshrink check
mailshrink analyze
mailshrink plan example.com
mailshrink compress --domain example.com --folder Sent --before 2025-01-01 --apply
Learn how to deploy MailShrink with Ansible, automate background cronjobs with ionice/nice, perform mass scanning, and optimize storage before migrations.