mdfrm

(List From and Subject of mail in a maildir)

SYNOPSIS

mdfrm [-hvcdnsu] [maildir]

mdnfrm [-hvcds] [maildir]

REQUIREMENTS

Only Perl 5.001 is required for basic functionality. If you want to use the -d option, the Date::Parse module (part of the TimeDate distribution on CPAN) is also required.

DESCRIPTION

mdfrm prints the name from the From: header and the Subject: header of all mail stored in a given maildir sorted by arrival date. If no maildir is specified on the command line, mdfrm will default to the path in the environnment variable MAILDIR or to a default path of $HOME/Maildir (configured at the top of this script). If invoked as mdnfrm (or nfrm), see the description of the option -n below.

Any From: headers encoded with RFC 2047 encoding, using quoted-printable, and with a character set of ISO 8859-1 or 8859-15 will be decoded before display and sent to the output as literal eight-bit characters.

This program is no longer under active development. It has been replaced with mdfrm-utf8, which supports a much broader range of character sets and assumes a UTF-8 locale.

OPTIONS

-c

Rather than displaying a summary of the messages, just print a single line giving the count of messages. This option works in conjunction with -n and -u in the expected ways. If you want to see both the count and the summary, also use -s.

-d

Sort the displayed summary by the Date: headers of the mail rather than by arrival date. Use of this flag requires the Date::Parse module be installed (part of TimeDate). (If you do not use this flag, you do not need that module.)

-h

Show a usage summary.

-n

Limit the summary to new (unread) messages (messages located in the new subdirectory of the maildir and excluding messages in the cur subdirectory). This option is the default if this program is invoked as mdnfrm or nfrm (or any other name containing "nfrm").

-s

Print a summary of messages. This is the default behavior; this option is only needed in combination with -c if you want to see both the count of messages and the summary.

-u

Only show messages which haven't been seen (read with a mail client). This uses the status flags in the info section of a message name (the part after :2,). See <http://cr.yp.to/proto/maildir.html> for more information on status flags.

This option doesn't really make sense in combination with -n since new messages by definition haven't been read and a mail client should move messages into the cur subdirectory when the user looks at them.

-v

Show the program version.

DIAGNOSTICS

cannot open %s

mdfrm was unable to open the specified file or directory. This can happen if the specified maildir was incorrect, or if mail was being read while mdfrm was running and some of the messages were moved or deleted while it was retrieving Subject or From headers.

only one maildir argument supported

More than one maildir was specified on the command line. Currently, mdfrm can only summarize one maildir at a time. To summarize multiple maildirs, run mdfrm multiple times with different arguments.

unknown flag %s

An unknown command-line flag was passed to mdfrm.

EXAMPLES

Summarize all of the mail in MAILDIR ($HOME/Maildir if MAILDIR isn't set):

    mdfrm

Display only the new messages in the maildir Mail/incoming, sorted by the Date headers rather than by file name (arrival time):

    mdfrm -nd

Display a count of unseen messages (in both the new and cur directories):

    mdfrm -cu

Show the count and summary of unseen messages, sorted by date.

    mdfrm -csd

If maildirs are used exclusively on your system, it may be a good idea to install mdfrm as frm.

ENVIRONMENT

MAILDIR

The path to the maildir to summarize, used if no maildir is given on the command line.

BUGS

This program does not as yet do anything remotely reasonable with RFC 2047 encoded header lines. It attempts to decode the From header under some circumstances, assuming that the user is a Western European or American. This is not a reasonable assumption, and even that decoder doesn't correctly follow the RFC 2047 specification.

The user should be able to specify which character sets to decode with a command-line option, RFC 2047 should be followed correctly, and base64 encoding should be handled correctly.

Continuation lines are not handled in either Subject: or From:, even if the full header content would fit on a single line.

SEE ALSO

frm(1), maildir(5), mdfrm-utf8(1)

The maildir format is documented at <http://cr.yp.to/proto/maildir.html>.

<http://www.eyrie.org/~eagle/software/mdfrm/> will have the current version of this program and of mdfrm-utf8.

AUTHOR

Russ Allbery <rra@stanford.edu>

COPYRIGHT AND LICENSE

Copyright 1997, 1998, 2002, 2003 by Russ Allbery <rra@stanford.edu>

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.

THANKS

RFC 2047 decoding logic courtesy of Mikko Hänninen and Sverre H. Huseby. Support for nfrm (-n) courtesy of Vebjørn Ljoså. Support for Date header sorting (-d) inspired by the work of Matthew Mead. Documentation and usage message based on work by Sotiris Vassilopoulos. Implementation of -u, -c, and -s from Russell Steinthal.

Last spun 2013-07-01 from POD modified 2007-07-09