james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: Questions on the Mail and MailRepository interfaces
Date Wed, 16 May 2007 13:07:00 GMT
Hi,

On 5/15/07, robert burrell donkin <robertburrelldonkin@gmail.com> wrote:
> how do you plan to model MIME messages?

I'm still looking at various alternative models, but the basic idea is
that the message is stored in as parsed format as possible. My current
thinking is:

A message consists of a envelope and the contained message. In JCR
this is represented as the james:mail subclass of the standard nt:file
node type (see http://wiki.apache.org/jackrabbit/nt%3afile):

    [james:mail] > nt:file
    - james:state (STRING)
    - james:error (STRING)
    - james:sender (STRING)
    - james:recipients (STRING) multiple
    - james:remotehost (STRING)
    - james:remoteaddr (STRING)
    - jamesattr:* (UNDEFINED)

See http://jackrabbit.apache.org/doc/nodetype/cnd.html for backgound
on the node type notation I'm using. The nt:file type defines a single
child node, called "jcr:content" that can contain anything, not just
the traditional binary stream. James would typically use one of the
following mime node types for the jcr:content node, but a nice feature
of this extensible content model is that we're not restricted to just
mail messages and could in fact use the same spool management code to
handle any kinds of message payloads like files, serialized java
objects, or even entire subtrees of content.

Normal mail messages are represented as a tree of MIME entities or
parts. Each entity is individually referenceable (for easy linking and
quick access) and contains associated the mail headers as string
attributes:

    [mail:part] > mix:referenceable
    - mail:* (STRING) multiple

Non-multipart entities are stored as mime:bodypart nodes that extend
the standard nt:resource node type (see
http://wiki.apache.org/jackrabbit/nt%3aresource) that defines
properties for the binary content and the associated content type:

    [mail:bodypart] > mail:part, nt:resource

Multipart entities are stored as mime:multipart nodes that extend the
standard nt:folder node type (see
http://wiki.apache.org/jackrabbit/nt%3afolder):

    [mail:multipart] > mail:part, nt:folder

Using the nt:folder type allows multipart messages to be easily
managed using standard JCR tools like the WebDAV interface included in
Jackrabbit.

I'm still undecided on how deep I should go in pre-parsing the message
contents. For example should I parse Date headers and store them as
JCR DATE properties to enable efficient date-based queries? Another
complex question is how to best handle encryption and digital
signature mechanisms like S/MIME...

BR,

Jukka Zitting

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message