List:General Discussion« Previous MessageNext Message »
From:Thufir Date:August 13 2012 11:56pm
View as plain text  
I'm using the GNU NNTP API to connect to a NNTP server, leafnode, 
running on localhost.  This API uses javax.mail.Message and there's no 
convenient way to lookup a specific Message without opening a Folder and 
searching through the messages, which is fine for a small number of 
articles, but not for a large number of articles.

Which leads me to the bad idea of persisting javax.mail.Message objects 
to database.  A typical header looks like so:

Message-ID: <x1-C1iPqemFLiwhpQ0xuzBgTTKTroQ@stripped>
From: Scott Knaster <post@stripped>
Subject: Fridaygram: Web Lab, holey Mars, Earth opposite
Date: Fri, 20 Jul 2012 19:35:13 +0200
Lines: 15
Approved: news@stripped
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Trace: 1342807330 19811 (20 Jul 2012 
18:02:10 GMT)
X-Complaints-To: usenet@stripped
NNTP-Posting-Date: Fri, 20 Jul 2012 18:02:10 +0000 (UTC)
X-Content-Hash: ZtGCfjo23fkSXHkU5acnV+nWVKk

The last header, Xref, has the article number.  (Unfortunately, this API 
provides no mechanism for looking up articles by their number.)

Obviously, I don't need all of those headers.  However, for design 
should that be a many-to-many between the articles table and the headers 
table?  Or, should I just have a table with some of those headers for 

The content is generally plaintext, but could have html or jpeg's.  I'm 
not dealing with large attachments, at worst an image or two.  Mostly 
text.  Should the content be in its own table?


javax.mail.MessageThufir13 Aug