If you get mail from someone called MAILER-DAEMON, please do not send mail back to it. The MAILER-DAEMON is a program and gets cranky when people mail it.

— MOTD on Stony Brook's Instructional Computing Network


mdfrm, frm for maildirs, is a reimplementation of the venerable frm program (traditionally found as part of the elm distribution) to work with maildirs instead. For more information on maildirs, see the maildir protocol description. In brief, a maildir is a way of storing mail in one file per message so that delivery can be done safely over NFS and no escaping of characters in messages is necessary. It was first invented by Dan Bernstein as part of qmail, and has since been adapted by many other MDAs.

The frm program, for those who are not already familiar with it, summarizes the contents of a mailbox, listing the subject and the name from the From: header for every message in the mailbox. It can optionally only show new messages. mdfrm does essentially the same thing, either displaying a summary of all mail in the new and cur directories of the maildir, or just the new directory.

The current version is now the version listed below as mdfrm-utf8, which handles decoding of RFC-2047-encoded headers and makes educated guesses about the encoding of unmarked headers. The program named mdfrm, which assumes ISO 8859-15 output, is frozen and will probably not get any further development.

This program, while written in Perl, tries to start up and run quickly. I probably run this program more times in a day than any program other than basic Unix shell commands like ls, and I want the response to be essentially immediate.

GNU mailutils now also comes with a frm program, but the last time I tried to use it it didn't support some of the formatting and output tweaks I implemented in mdfrm. It would be good at some point to get equivalent changes implemented in the GNU mailutils frm program, since GNU mailutils is often already installed on Linux systems.


mdfrm-utf8 uses the current Unicode features of Perl and therefore requires Perl 5.8.0 or later and uses the Encode and Encode::Guess modules (which comes with Perl at that version). It also assumes that you're using a UTF-8 locale and that your display can handle UTF-8 characters. If you want to sort the messages by the Date header rather than by filename (which given the algorithm for writing to a maildir generally means sorting by arrival time), the Date::Parse module (part of the TimeDate distribution on CPAN) is also required.

mdfrm only requires Perl 5.001 and is still available for users who don't care about the UTF-8 and national character set support. It similarly requires Date::Parse for sorting by the Date header.


The programs:

mdfrm-utf8 1.1 2007-08-01 Download
mdfrm 1.9 2007-07-09 Download



Copyright 1997, 1998, 2002, 2003, 2007 by Russ Allbery <>.

These programs are free software; you may redistribute them and/or modify them under the same terms as Perl itself. This means that you may choose between the two licenses that Perl is released under: the GNU GPL and the Artistic License. Please see your Perl distribution for the details and copies of the licenses.

Last modified and spun 2014-08-10