Add isds_normalize_mime_type() public function
[libisds.git] / doc / message
blob450dcfb3df937d53fde15d429487ea227e318a00
1 Message specification
2 =====================
4 Source: Provozní řád ISDS, version 2009-10-30, Page 13
5 Source: Webové služby ISDS pro manipulaci s datovými zprávami, version 2.6
6     (2010-01-18) [DataMessage_ws.pdf]
7 Source: Registration of media type FO and ZFO
8     <http://www.alvestrand.no/pipermail/ietf-types/2008-June/002037.html>
10 Message ::= Envelope, Content
12 Message format is defined in Appendinx 1, file dmBaseTypes.xsd.
14 Content ::= (Document)+
16 Content involves one or more attachments (= Documents). Allowed Document
17 formats are defined in Appendix 3 of Vyhláška o stanovení podrobností užívání
18 a provozování ISDS.
20 Currently (2009-11-18) allowed formats are (quotation follows):
22     – pdf (Portable Document Format)
23     – PDF/A (Portable Document Format for the Long-term Archiving)
24     – xml (Extensible Markup Language Document); must be valid against
25     free available XML Schema published by recipient
26     – fo/zfo (602XML Filler dokument)
27     – html/htm (Hypertext Markup Language Document)
28     – odt (Open Document Text)
29     – ods (Open Document Spreadsheet)
30     – odp (Open Document Presentation)
31     – txt (plain text)
32     – rtf (Rich Text Format)
33     – doc (MS Word Document)
34     – xls (MS Excel Spreadsheet)
35     – ppt (MS PowerPoint Presentation)
36     – jpg/jpeg/jfif (Joint Photographic Experts Group File Interchange Format)
37     – png (Portable Network Graphics)
38     – tiff (Tagged Image File Format)
39     – gif (Graphics Interchange Format)
40     – mpeg1/mpeg2 (Moving Picture Experts Group Phase 1 / Phase 2)
41     – wav (Waveform Audio Format)
42     – mp2/mp3 (MPEG-1 Audio Layer 2 / Layer 3)
43     – isdoc/isdocx (Information System Document) version 5.2 or higher
45 Document format declaration inside Document and conformace checks change
46 during time. XML Schemas provide attribute for Document MIME type and Document
47 annotation.
49 Attribute dmMimeType must present, but may be empty, may contain file name
50 extension, or may contain official MIME type. If MIME type is declared, ISDS
51 checks Document content for conformance to the MIME type.
53 There is MIME type blacklist: application/x-zip-compressed,
54 application/x-msdownload.
56 Attribute dmFileDescr (so called annotation) must present and must contain
57 file name of the Document. Even if dmMimeType exists, ISDS uses THIS attribute
58 to detect Document format (according file name extension) and checks content
59 for format conformance.
61 There is list of allowed file name extensions: pdf, xml, fo, zfo, html, htm,
62 odt, ods, odp, txt, rtf, doc, xls, ppt, jpg, jpeg, jfif, png, tiff, gif, mpeg1
63 mpeg2, wav, mp2, mp3, isdoc, isdocx, cer, crt, der, pk7, p7b, p7c, p7f, p7m,
64 p7s, tst (time stamp).
66 Non-normative: File name extenstion to MIME type map:
68 Extensions  MIME type           Description
69 -------------------------------------------------------------------------------
70 pdf         application/pdf     Portable Document Format
71 xml         application/xml     Extensible MarkUp Language
72 fo          application/vnd.software602.filler.xml+form
73                                 602XML form (uncompressed)
74 zfo         application/vnd.software602.filler.xml+zip+form
75                                 602XML form (zipped XML form with XSL-FO styles)
76 html, htm   text/html           Hyper Text MarkUp Language
77 odt         application/vnd.oasis.opendocument.text
78                                 Open Document Format Text
79 ods         application/vnd.oasis.opendocument.spreadsheet
80                                 Open Document Format Spreadsheet
81 odp         application/vnd.oasis.opendocument.presentation
82                                 Open Document Format Presentation
83 txt         text/plain          Plain text (no charset nor encoding signalled)
84 rtf         application/rtf     Rich Text Format
85 doc         application/msword  Microsoft Word Document
86 xls         application/vnd.ms-excel
87                                 Microsoft Excel Document
88 ppt         application/vnd.ms-powerpoint
89                                 Microsoft PowerPoint Document
90 jpg, jpeg, jfif
91             image/jpeg          JFIF/JPEG image
92 png         image/png           Portable Network Graphics
93 tiff        image/tiff          Tag Image File Format
94 gif         image/gif           Graphics Interchange Format
95 mpeg1       video/mpeg          Motion Joint Picture Expert Group Version 1
96 mpeg2       video/mpeg2         Motion Joint Picture Expert Group Version 2
97 wav         audio/x-wav         RIFF Waveform Audio File Format
98 mp2         audio/mpeg          MPEG-1 Audio Layer II
99 mp3         audio/mpeg          MPEG-1 Audio Layer III
100 isdoc, isdocx
101                                 Information System Document (payment invoice)
102 cer, crt, der
103                                 X.509 Certificate (different serialization)
104 pk7, p7b, p7c, p7f, p7m, p7s
105                                 Crypto Message Syntax (different serialization)
106 tst                             Time Stamp Token (RFC 3161)
109 Document ::= Binary_Document | XML_Document
111 Document is Base64 encoded binary format or XML.
113 There exist special Document type, ESS format, that can exist in Content only
114 once.
116 Note: ESS format is special XML language designed as interface between
117 Electronic Document Systems (ESS). It's defined in Appendix 4 of Provozní řád
118 ISDS.
120 Message with `malicious code' will be refused by ISDS.
122 Maximal total size of Documents in a Message is 10 MB. Binary document size is
123 size before encoding into Base64, XML document size is size in bytes as is
124 serialized inside SOAP request.
126 A Message can be addressed to 50 recipients at maximum.
128 Life time of Message:
130     – 90 days for delivered message
131     – unlimited for delivered through fiction messages, however they can be
132     moved to off-line storage after 90 days. User can request to move the
133     Message back into his box (off-line only currently).
135 Deleted messages are stored off-line as Envelope only without Content.
137 Note: Delivery through fiction is currently defined as new unread for more
138 than 10 days after delivery.
141 Digital Signatures
142 ==================
144 Emeded digital signatures are PKCS#7 to avoid expensive XML canonicalization.
147 System messages
148 ===============
150 There exists special message type iniciated by ISDS (i.e. from system, not from
151 other box). Such message has reserved from-box `aaaaaaa' (7 × `a') value and
152 sender type `0' and it contains always document of type HTML. There are
153 following cases defined:
155 1   Outgoing message contained malicious code
156 2   You, administrator, deleted other user
157 3   Outgoing message could not been delivered because recipeient box had been
158     made unaccessible
159 4   Outgoing commercial message has not been accepted by recipient
160 5   User has been added to the box
161 6   User permissions has been changed
164 Commercial messages
165 ===================
167 Users can allow commercial message receiving explicitelly. Commercial message
168 are not considered as accepted by recipient automatically (in opposite to
169 standard messages), recipient must call ConfirmDelivery to move message from
170 state Delivered (4) to state Received (6).
172 User can request to assign permission to send commercial messages. Permission
173 can be assigned by Czech Post. Commecial recipient can not be searched. Sender
174 must know exact box ID.
176 Commercial message can be recognised by @dmType="K" in message envelope. If
177 @dmType is "V" or attribute is missing, message is so called public (i.e.
178 standard noncommercial with acceptence time outs etc.).
181 Message states
182 ==============
184 Value   Meaning
185 1       Message has been put into ISDS
186 2       Message stamped by TSA
187 3       Message included virues, infected document has been removed
188 4       Message delivered (dmDeliveryTime stored)
189 5       Message delivered through fiction (dmAcceptanceTime stored)
190 6       Message delivered by user login or user explicit request (in case of
191         commercial message) (dmAcceptanceTime stored)
192 7       Message has been read by user
193 8       Message could not been delivered (e.g. recipent box has been made
194         unaccessible meantime)
195 9       Message content deleted (thus can not be obtained on-line)
196 10      Message stored into data safe (this is optional commercial service)