Summary: Looking for a tool to report vsize of messages by UIDL, or other ways to investigate vsize inconsistency between converted (maildir) and original (mbox) mailboxes.
I am the administrator of a mail server configured with exim4, dovecot, and mbox mail storage. The system formerly used UW-IMAP, but I made an uneventful conversion to dovecot a few years ago.
Some months ago, I attempted to convert from mbox to maildir without success. As I prepared to try again, I am testing more thoroughly. I captured the mbox files from /var/mail and from /home/<username>/mail for IMAP users, and moved them to a virtual machine to practice the conversion there.
I took these steps on the virtual machine:
Turn off Exim. /etc/exim4 stop Modify dovecot configuration and restart dovecot. The two changes needed are conf.d/10-mail.conf: mail_location = maildir:/home/%u/Maildir conf.d/10-mail.conf: separator = /
To convert from mbox to maildir, I used this command for each user:
doveadm backup -f -R -u "$U" "mbox:/home/$U/mail:INBOX=/var/mail/$U" || exit
That completed without reporting any errors.
Before attempting the conversion, I used this shell script to get status information about each mailbox. It uses 'doveadm mailbox list' to get a list of mailboxes for each user, and 'doveadm mailbox status' to provide summary information. For example (username redacted)
zxxxxxxx: INBOX messages=6 recent=0 unseen=4 vsize=7820215
================= mailbox-status.sh ===================== #!/bin/bash
USERS=$(ls -1 /var/mail | grep -v ".lock" | sort)
for U in $USERS; do doveadm mailbox list -u "$U" | while read -r BOX do echo "$U: $BOX " $(doveadm mailbox status -u "$U" -t all "$BOX") done done
========================================================
I used my mailbox status script again after the conversion to report on the maildir mailboxes.
Of the 143 mailboxes found by the script, there are three where the status does not exactly match between the old mailboxes and the new mailboxes. The difference is only in the vsize. Sometimes the new vsize is large; sometimes it is smaller.
The way I can think of to investigate this is to use a tool that will report the vsize for each message in the mailbox, identified by UIDL. Then, compare the before/after reports, and then figure out what is going on with what I hope is one or a small number of messages in the mailbox. I can probably code up such a tool in Python. Does anyone know of existing tools? Or know of a better way to investigate?
Thanks,
Ken