From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Harald Hanche-Olsen Newsgroups: gmane.emacs.devel Subject: Re: Recognize mbox files? Date: Mon, 09 Feb 2009 20:09:15 +0100 (CET) Message-ID: <20090209.200915.88699865272196957.hanche@math.ntnu.no> References: <878wofpj9h.fsf@cyd.mit.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1234207598 6770 80.91.229.12 (9 Feb 2009 19:26:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 Feb 2009 19:26:38 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org To: cyd@stupidchicken.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 09 20:27:53 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LWbnM-0003b5-MZ for ged-emacs-devel@m.gmane.org; Mon, 09 Feb 2009 20:27:52 +0100 Original-Received: from localhost ([127.0.0.1]:53073 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LWbm1-0002ma-KB for ged-emacs-devel@m.gmane.org; Mon, 09 Feb 2009 14:26:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LWbVR-00061W-Ul for emacs-devel@gnu.org; Mon, 09 Feb 2009 14:09:22 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LWbVQ-00060s-4t for emacs-devel@gnu.org; Mon, 09 Feb 2009 14:09:20 -0500 Original-Received: from [199.232.76.173] (port=48010 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LWbVP-00060c-Fn for emacs-devel@gnu.org; Mon, 09 Feb 2009 14:09:19 -0500 Original-Received: from fiinbeck.math.ntnu.no ([129.241.15.140]:50896) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1LWbVO-0004LK-RC for emacs-devel@gnu.org; Mon, 09 Feb 2009 14:09:19 -0500 Original-Received: (qmail 5762 invoked from network); 9 Feb 2009 19:09:15 -0000 Original-Received: from localhost (127.0.0.1) by localhost with SMTP; 9 Feb 2009 19:09:15 -0000 In-Reply-To: <878wofpj9h.fsf@cyd.mit.edu> X-URL: http://www.math.ntnu.no/~hanche/ X-Mailer: Mew version 6.2.50 on Emacs 23.0.60 / Mule 6.0 (HANACHIRUSATO) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:108901 Archived-At: + Chong Yidong : > Richard M Stallman writes: > > > Is it reliable enough to recognize mbox files > > that we could visit them automatically in Rmail mode? > > I don't think so. Mbox files are lines that begin with "From ", > separated by arbitrary data. There's not enough information to > autodetect them. But there is more: There should be an RFC 822 header behind the "From " line. Checking for complete RFC 822 compliance may be too much, but at least, if you look for a bunch of lines matching '^[a-z][-a-z]*:', each followed by zero or more lines beginning with white space, and the whole bunch followed by an empty line, you're getting close. Bonus points for detecting specific headers such as Subject: From: and Message-ID:. (Beware that some mail programs like to stuff a bogus message at the start of the mbox file in which they can store their own data. This message might miss a Message-ID:, but otherwise it should look normal.) - Harald