File: DESIGN

package info (click to toggle)
kf5-messagelib 4:18.08.3-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 66,672 kB
  • sloc: cpp: 84,452; xml: 302; sh: 25; makefile: 13
file content (44 lines) | stat: -rw-r--r-- 1,785 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
How the composer works:
--------------------------
Input data:

MessagePart classes represent the data of messages in an abstract way that is very close to
the way a GUI composer would see the data.  Thus, the composer takes the folowing input data:
* GlobalPart:
  - The charsets the user prefers.
  - Whether 8bit encoding is allowed.
* InfoPart:
  - Mode: compose the messages to be sent, or to be saved somewhere locally.
  - Sender and recipients.
  - The transport to use.
* TextPart:
  - The plain text and, optionally, the HTML text from an editor.
* Zero or more AttachmentParts:
  - The data and details (such as MIME type, file name) of an attachment.

--------------------------
Output data:

The composer outputs a single KMime::Message containing the assembled message.

--------------------------
Logic:
(NOTE: Based on messagecomposer.cpp in KMail. This does not apply. This is
TODO in the crypto composer.)

Definitions:
* Early attachment -- An attachment that has the same signing / crypto settings as the main
                      text part, and is joined with the text part before any signing or
                      encryption.
* Late attachment  -- An attachment that has different signing / crypto settings from the main
                      text part, and is encrypted, signed, and added only after the main part
                      has been signed and encrypted.

Algorithm:
1) Take the text content (plain or plain+HTML) and the early attachments, and compose them
   into contentBeforeCrypto.
2) For each recipient of the message, encrypt contentBeforeCrypto, encrypt and add the late
   attachments, save the recipients address (so that we know whom to send this message to),
   and save this as one of the final messages.

--------------------------