
Managing Maildir mailboxes across multiple users can quickly become a challenge. How do you find out who’s using the most space, how many messages each mailbox contains, or how many are unread?
Maildir Insights is a simple shell script that gives you a fast, clear overview of your Maildir mailboxes – all with one command.
What Maildir Insights Does
- Scans all user
Maildir
folders under/home
- Shows total mailbox size and message counts
- Breaks down messages by folder:
new
,cur
, andtmp
- Detects read, unread, and deleted messages based on Maildir flags
- Includes counts for
.Trash
folder - Outputs a neat, tabular summary ready for reports or scripts
Sample Output
HOMEDIR SIZE COUNT NEW CUR TMP DIR READ UNREAD TRASH
/home/alice/Maildir 1.2G 10452 320 10120 12 15 9022 1430 250
/home/bob/Maildir 845M 8330 210 8100 20 11 7100 1230 300
Runtime: 0 Minutes 2 Seconds
How to Use Maildir Insights
- Save the script below as
maildir-insights.sh
- Make it executable:
chmod +x maildir-insights.sh
- Run it:
./maildir-insights.sh
The script automatically scans /home/*/Maildir
and summarizes each mailbox.
The Script
You can find the latest version and source code on GitHub:
Clone the repository and run the script as explained in the README.
Why Use Maildir Insights?
- No dependencies — runs anywhere Bash is available
- Perfect for quick audits, migrations, or quota management
- Easy to integrate into cronjobs or monitoring scripts
- Clear, tabular output for effortless parsing or reporting
💡 Use Case
This script was originally written to compare the contents of Maildir trees before and after a mailbox migration using dovecot dsync
. However, it’s useful in any scenario where Maildir-based mailboxes need auditing, quota analysis, or inspection.