Software Mbox2maildir is a Perl script written by Bruce Guenter. Its job is to convert standard Unix mailboxes (mbox format) to Maildirs, which is useful for replacing an mbox-based system with a maildir-based one without losing current contents of users' INBOXen. One rather irritating feature of the script is that a converted mailbox loses message delivery time; all messages in the new maildir will appear to have been delivered at the time the maildir is created. The reason for this is that maildirs use the filesystem's timestamps to deduce delivery time, which is - of course - the time of conversion in the case of this script's output.
This patch removes this irritation by reading the "Delivery-date" header of each message (if it exists) and changing the message file's timestamp in the new maildir to reflect this date. The patch requires GNU touch to be installed. By default, it checks for /usr/bin/touch; if touch is installed elsewhere on your system, edit the top line of the script ($TOUCH_CMD='/usr/bin/touch') to reflect the true location.
The original mbox2maildir script can be found at the
QMail website. To apply the
patch, use the command patch mbox2maildir mbox2maildir.patch.
Alternatively, you can download the patched version of the whole script below.
This patch is released into the Public Domain.