Subject: [ietf-822] Detecting message/rfc822 file type

From: Alessandro Vesely <[email-masked]>
Date: Thu, 03 Jan 2013 16:20:21 +0100

Hi all,

as you certainly know, the file utility can detect a message/rfc822
mime type from a message.  It does so by recognizing the first line of
the file.  However, comparisons are qualified as case sensitive in the
magic file that I attach, except for the Delivered-To and Return-Path
that I just patched adding a "cC".  I'm about to send the patch to the
maintainer of the utility.

I'm not patching the "From:" entry, as I never saw a message starting
with it.  Should that entry be removed?  What other fields actually
happen to be on the top of the header?

For a short legend, the "!:mime" refers to the line just above it, and
the "0" that starts the latter is the offset; "string" implies a
string comparison and the "/t" is for text; whitespace is escaped in
the test string following it, and a message terminates the line.  The
magic file supports many other operations, including regex, search,
indirection, and more.  See the man page.  I found the latest version
(5.11) online at
http://www.dsm.fordham.edu/cgi-bin/man-cgi.pl?topic=magic&ampsect=5

TIA for any contribution.