Sun, 31 Mar 2019 17:45:25 -0400
Switch to GMime for sametime.
This causes a few differences (as shown in the tests):
* MIME headers are in a slightly different order,
* MIME headers use `Camel-Case` instead of `lower-case`,
* `Content-Type` includes a `charset` parameter,
* An extra newline at the end of MIME parts was dropped,
* Filenames in attachment parts are no longer quoted,
* `Content-Disposition` and image base64 data are now wrapped,
* Unix newlines are sent consistently as DOS newlines (but correctly
parsed back to Unix).
|
39525
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1 | { |
|
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
2 | /* A message with multiple lines. */ |
|
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
3 | .name = "multiline", |
|
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
4 | .html = |
|
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
5 | "This is a test of the MIME encoding using a multiline message.\n" |
|
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
6 | "This is the second line of the message.", |
|
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
7 | .mime = |
|
39526
4f678f514b69
Switch to GMime for sametime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39525
diff
changeset
|
8 | "Content-Type: multipart/related; boundary=related_MWa2f_0aac\r\n" |
|
4f678f514b69
Switch to GMime for sametime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39525
diff
changeset
|
9 | "Mime-Version: 1.0\r\n" |
|
4f678f514b69
Switch to GMime for sametime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39525
diff
changeset
|
10 | "Content-Disposition: inline\r\n" |
|
39525
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
11 | "\r\n" |
|
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
12 | "--related_MWa2f_0aac\r\n" |
|
39526
4f678f514b69
Switch to GMime for sametime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39525
diff
changeset
|
13 | "Content-Type: text/html; charset=us-ascii\r\n" |
|
4f678f514b69
Switch to GMime for sametime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39525
diff
changeset
|
14 | "Content-Disposition: inline\r\n" |
|
4f678f514b69
Switch to GMime for sametime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39525
diff
changeset
|
15 | "Content-Transfer-Encoding: 7bit\r\n" |
|
39525
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
16 | "\r\n" |
|
39526
4f678f514b69
Switch to GMime for sametime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39525
diff
changeset
|
17 | "This is a test of the MIME encoding using a multiline message.\r\n" |
|
39525
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
18 | "This is the second line of the message.\r\n" |
|
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
19 | "--related_MWa2f_0aac--\r\n" |
|
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
20 | }, |
|
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
21 | { |
|
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
22 | /* A message that ends with a newline. */ |
|
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
23 | .name = "trailing-newline", |
|
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
24 | .html = "This is a test of the MIME encoding using a multiline message.\n", |
|
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
25 | .mime = |
|
39526
4f678f514b69
Switch to GMime for sametime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39525
diff
changeset
|
26 | "Content-Type: multipart/related; boundary=related_MWa2f_0aac\r\n" |
|
4f678f514b69
Switch to GMime for sametime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39525
diff
changeset
|
27 | "Mime-Version: 1.0\r\n" |
|
4f678f514b69
Switch to GMime for sametime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39525
diff
changeset
|
28 | "Content-Disposition: inline\r\n" |
|
39525
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
29 | "\r\n" |
|
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
30 | "--related_MWa2f_0aac\r\n" |
|
39526
4f678f514b69
Switch to GMime for sametime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39525
diff
changeset
|
31 | "Content-Type: text/html; charset=us-ascii\r\n" |
|
4f678f514b69
Switch to GMime for sametime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39525
diff
changeset
|
32 | "Content-Disposition: inline\r\n" |
|
4f678f514b69
Switch to GMime for sametime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39525
diff
changeset
|
33 | "Content-Transfer-Encoding: 7bit\r\n" |
|
39525
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
34 | "\r\n" |
|
39526
4f678f514b69
Switch to GMime for sametime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39525
diff
changeset
|
35 | "This is a test of the MIME encoding using a multiline message.\r\n" |
|
39525
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
36 | "\r\n" |
|
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
37 | "--related_MWa2f_0aac--\r\n" |
|
e1280f3aaea8
sametime: Add MIME processing tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
38 | }, |