7 |
:Date-Created: 2002-10-28 |
:Date-Created: 2002-10-28 |
8 |
:Status: incomplete |
:Status: incomplete |
9 |
|
|
10 |
|
... |
11 |
|
|
12 |
Issues |
Issues |
13 |
------ |
------ |
14 |
|
|
15 |
* How are emails stored in a mediaserver. |
* How are emails stored in a mediaserver. |
16 |
|
|
17 |
|
- Separate header and body? - Yes: See Rationale |
18 |
|
|
19 |
- The way header and body of e-mails get separated. |
- The way header and body of e-mails get separated. |
20 |
|
|
21 |
- The same for multipart-message. |
- The same for multipart-message. |
22 |
|
|
23 |
- How are header-blocks and body-blocks connected. |
- How are header-blocks and body-blocks connected. |
24 |
|
|
25 |
Rationale |
Rationale |
26 |
--------- |
--------- |
27 |
|
|
28 |
|
... |
29 |
|
|
30 |
Description |
Description |
31 |
----------- |
----------- |
32 |
|
|
33 |
|
We store emails in Storm blocks, where the header of |
34 |
|
an email is stored in one block, and the body in another. |
35 |
|
In the case of multipart messages, the individual body |
36 |
|
parts get stored in a block for each part while the |
37 |
|
headers get stored in a single block. |
38 |
|
|
39 |
|
Non-multipart messages |
40 |
|
`````````````````````` |
41 |
|
|
42 |
When saving non-multipart-messages, header and body get |
When saving non-multipart-messages, header and body get |
43 |
separated and saved in a block respectively. In order |
separated and saved in a block respectively. In order |
44 |
to preserve the connection between header and body the |
to preserve the connection between header and body the |
45 |
content-type of the e-mail needs to be changed to |
content-type of the e-mail needs to be changed to |
46 |
message/external-body. In addition a new access-type, |
message/external-body. In addition a new access-type, |
47 |
called ``storm`` is introduced. It has a parameter |
called ``x-storm`` is introduced. It has a parameter |
48 |
``block`` which holds the ID of the block containing |
``block`` which holds the ID of the block containing |
49 |
the body. |
the body. |
50 |
|
|
51 |
|
The Content-Type of the block is ``message/rfc822``. |
52 |
|
Additionally the message-ID (if existent) and the |
53 |
|
Content-Transfer-Encoding are field of the header. |
54 |
|
Nothing more. |
55 |
|
After the block's header the following is inserted:: |
56 |
|
|
57 |
|
Content-Type: message/external-body; |
58 |
|
access-type="x-storm"; |
59 |
|
block="<ID>" |
60 |
|
|
61 |
|
where <ID> is the ID of the body's block. |
62 |
|
|
63 |
An example:: |
An example:: |
64 |
|
|
65 |
|
Content-Type: message/rfc822 |
66 |
|
|
67 |
Content-Type: message/external-body; |
Content-Type: message/external-body; |
68 |
access-type="storm"; |
access-type="x-storm"; |
69 |
block="ID" |
block="ID" |
70 |
|
|
71 |
|
From: Marc Schiereck <kanonensau@gmx.net> |
72 |
|
To: gzz developers list <gzz-dev@mail.freesoftware.fsf.org> |
73 |
|
Subject: Sample message |
74 |
|
Content-Type: text/plain |
75 |
|
|
76 |
|
Multipart messages |
77 |
|
`````````````````` |
78 |
|
|
79 |
This works similar for multipart-messages. The message |
This works similar for multipart-messages. The message |
80 |
header stays untouched. Only the bodies of the individual |
header stays untouched. Only the bodies of the individual |
85 |
message/external-body and the parameters ``access-type`` |
message/external-body and the parameters ``access-type`` |
86 |
and ``block`` are added as in non-multipart-messages. |
and ``block`` are added as in non-multipart-messages. |
87 |
|
|
88 |
An example for a multipart-header:: |
An example for a multipart-header block:: |
89 |
|
|
90 |
From: Marc Schiereck <kanonensau@gmx.net> |
From: Marc Schiereck <kanonensau@gmx.net> |
91 |
To: gzz developers list <gzz-dev@mail.freesoftware.fsf.org> |
To: gzz developers list <gzz-dev@mail.freesoftware.fsf.org> |
92 |
Subject: Sample message |
Subject: Sample message |
93 |
Content-type: multipart/mixed; |
Content-type: multipart/mixed; |
94 |
boundary="boundary" |
boundary="boundary" |
95 |
|
|
96 |
--boundary |
--boundary |
97 |
Content-Type: message/external-body; |
Content-Type: message/external-body; |
98 |
access-type="storm"; |
access-type="x-storm"; |
99 |
block="<ID-part1>" |
block="<ID-part1>" |
100 |
|
|
101 |
|
Content-Type: ... |
102 |
|
Content-Transfer-Encoding: binary |
103 |
|
|
104 |
--boundary |
--boundary |
105 |
Content-Type: message/external-body; |
Content-Type: message/external-body; |
106 |
access-type="storm"; |
access-type="x-storm"; |
107 |
block="<ID-part2>" |
block="<ID-part2>" |
108 |
|
|
109 |
|
Content-Type: ... |
110 |
|
Content-Transfer-Encoding: binary |
111 |
|
|
112 |
--boundary-- |
--boundary-- |
113 |
|
|
114 |
|
Implementation |
115 |
|
-------------- |
116 |
|
|
117 |
|
The implementation language is Python 2.1. |
118 |
|
|
119 |
|
To store a single mail the following function will |
120 |
|
be defined:: |
121 |
|
|
122 |
|
storeMail(mail, mediaserver) |
123 |
|
|
124 |
|
``mail`` is a string holding the complete mail (header |
125 |
|
and body. They get separated inside the function). |
126 |
|
|