我有一個巨大的mbox文件,其中可能有500封電子郵件。如何使用bash或Perl重新格式化mbox文件中的消息?
它看起來像如下:
From [email protected] Fri Aug 12 09:34:09 2005
Message-ID: <[email protected]>
Date: Fri, 12 Aug 2005 09:34:09 +0900
From: me <[email protected]>
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: someone <[email protected]>
Subject: Re: (no subject)
References: <[email protected]>
In-Reply-To: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Status: RO
X-Status:
X-Keywords:
X-UID: 371
X-Evolution-Source: imap://[email protected]/
X-Evolution: 00000002-0010
Hey
the actual content of the email
someone wrote:
> lines of quotedtext
我想知道我怎麼可以刪除所有引用文字,剝離大部分的頭,除了收件人,發件人和日期線,而且還有它有點連續。
我的目標是能夠將這些電子郵件作爲書籍格式打印出來,此時每個程序都希望每頁打印一封電子郵件,或者所有的標題和引用文本。對於從哪裏開始使用shell工具來啓動一個小程序有什麼建議?
你不會顯示一個,但是如果標題和正文之間沒有空白行,那麼您就處於深層次的doo-doo中。 – 2008-12-10 17:02:55
嘿被算作身體,所以它應該罰款? – 2008-12-10 17:10:09
在你的例子中,沒有什麼能夠告訴身體何處開始。在RFC-822中,主體由其之前的空白行定義。 – 2008-12-10 17:22:54