MailShrink

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
📊

Analyze

Scan your server and see exactly how much space is reclaimable — measured from real samples, not guesswork.

🔒

Safe by Default

Dry-run mode, Dovecot zlib verification, atomic operations, and metadata preservation. Nothing is modified until you say so.

⚡

Zero Dependencies

Single static binary. Download, chmod, run. Works on Ubuntu, AlmaLinux, Rocky, Debian — any Linux with Dovecot.

Terminal Demo

MailShrink Terminal Demo

Quick Start

1

Verify Dovecot is ready

mailshrink check
2

See how much space you can reclaim

mailshrink analyze
3

Review the plan

mailshrink plan example.com
4

Compress old mail

mailshrink compress --domain example.com --folder Sent --before 2025-01-01 --apply

Works With

cPanel / WHM DirectAdmin Custom Dovecot Ubuntu Debian AlmaLinux Rocky Linux RHEL

📖 Production & Bulk Automation Guide

Learn how to deploy MailShrink with Ansible, automate background cronjobs with ionice/nice, perform mass scanning, and optimize storage before migrations.

Read the Guide →