|
1 // ########################################### |
|
2 // |
|
3 // Author: Santiago Rilova |
|
4 // Date: 20/08/2003 |
|
5 // |
|
6 // This tests Sirocco PREQ98- Storing received mail messages. User MUST be able to change the character set |
|
7 // without loosing data independently of original character set. |
|
8 // It downloads emails from a server, some of which have corrupted charset information. It then dumps the messages |
|
9 // and compares the output against reference files to verify it is correct. |
|
10 // |
|
11 // Execution: |
|
12 // 1. Copy this file to c:\msgtest\emailsmoke |
|
13 // and execute "t_email -testparams imapCharsetTests" |
|
14 // |
|
15 // |
|
16 // Pre-requisites: |
|
17 // 1. The mail account specified in imap_service_MsgExchange must contain the required emails |
|
18 // 2. The PREQ98 feature must be activated in the IMCM.RSC file (edit IMCM.RSS to update flag store_8bit_body_text |
|
19 // to value=1 and recompile the resource file) |
|
20 // |
|
21 // #################################################### |
|
22 |
|
23 [main] |
|
24 email_client_test email |
|
25 |
|
26 // Perform the test steps. |
|
27 |
|
28 [email] |
|
29 imap_client_test imap_init_mail_folders |
|
30 imap_client_test create_IMAP_service |
|
31 imap_client_test imap_do_inbox_sync_service |
|
32 //imap_client_test dump_mail_store |
|
33 imap_client_test dump_bodies |
|
34 imap_client_test verify_body_text |
|
35 imap_client_test verify_attachment_names |
|
36 imap_client_test verify_header_fields |
|
37 |
|
38 // Delete the mail folder |
|
39 [imap_init_mail_folders] |
|
40 add_comment Clean message folder in C drive |
|
41 clean_message_folder |
|
42 add_comment Start client session |
|
43 start_client_session |
|
44 |
|
45 // |
|
46 // Create IMAP service |
|
47 // |
|
48 [create_IMAP_service] |
|
49 add_comment Create IMAP service for testing |
|
50 select_root_folder |
|
51 imap_service imap_service_MsgExchange |
|
52 select_folder test_imap_service |
|
53 add_comment Connecting |
|
54 connect |
|
55 check_imap_error 0 |
|
56 add_comment Synchronising tree |
|
57 sync_tree |
|
58 check_imap_error 0 |
|
59 add_comment Disconnecting |
|
60 disconnect |
|
61 check_imap_error 0 |
|
62 |
|
63 [imap_do_inbox_sync_service] |
|
64 add_comment Do sync |
|
65 select_root_folder |
|
66 select_folder test_imap_service |
|
67 add_comment Connecting |
|
68 connect |
|
69 check_imap_error 0 |
|
70 select_root_folder |
|
71 select_folder test_imap_service |
|
72 select_folder Inbox |
|
73 add_comment Sync Inbox |
|
74 sync_folder |
|
75 select_all_messages |
|
76 add_comment Populate the message (download the body text) |
|
77 populate_folder |
|
78 add_comment Message downloaded |
|
79 add_comment Disconnecting |
|
80 disconnect |
|
81 check_imap_error 0 |
|
82 |
|
83 [dump_mail_store] |
|
84 dump_mail_store dump1\ |
|
85 |
|
86 [dump_bodies] |
|
87 add_comment Do sync |
|
88 select_root_folder |
|
89 select_folder test_imap_service |
|
90 add_comment Connecting |
|
91 connect |
|
92 check_imap_error 0 |
|
93 select_root_folder |
|
94 select_folder test_imap_service |
|
95 select_folder Inbox |
|
96 select_all_messages |
|
97 // |
|
98 // Change to the correct charset |
|
99 // |
|
100 // change to gb2312, KCharacterSetIdentifierGb2312=0x10000fbe (=268439486) |
|
101 // Change to ISO 88591 KCharacterSetIdentifierIso88591=0x10003b10 (=268450576) |
|
102 //change_charset 268450576 |
|
103 // |
|
104 // Dump the bodies |
|
105 // |
|
106 select_entry plain_text_non_mime |
|
107 dump_body_text plain_text_non_mime.txt |
|
108 change_charset 268450576 |
|
109 dump_body_text plain_text_non_mime2.txt |
|
110 // |
|
111 select_entry test_plain_bodytext_no_encoding |
|
112 dump_body_text test_plain_bodytext_no_encoding.txt |
|
113 // |
|
114 select_entry corrupted_charset_test_plain_bodytext_no_encoding |
|
115 change_charset 268450576 |
|
116 dump_body_text corrupted_charset_test_plain_bodytext_no_encoding.txt |
|
117 // |
|
118 select_entry test_plain_bodytext_with_attach_no_encoding |
|
119 dump_body_text test_plain_bodytext_with_attach_no_encoding.txt |
|
120 // |
|
121 select_entry corrupted_charset_test_plain_bodytext_with_attach_no_encoding |
|
122 change_charset 268450576 |
|
123 dump_body_text corruptd_charset_test_plain_bodytext_with_attach_no_encoding.txt |
|
124 // |
|
125 select_entry test_plain_bodytext_qp_encoding |
|
126 dump_body_text test_plain_bodytext_qp_encoding.txt |
|
127 // |
|
128 // no need to change charset on this one because it has invalid charset info, so default charset (which is |
|
129 // the correct one, is used anyway) |
|
130 select_entry corrupted_charset_test_plain_bodytext_qp_encoding |
|
131 dump_body_text corrupted_charset_test_plain_bodytext_qp_encoding.txt |
|
132 // |
|
133 // lets try changing it anyway...should come up with the same output |
|
134 // |
|
135 select_entry corrupted_charset_test_plain_bodytext_qp_encoding |
|
136 dump_body_text corrupted_charset_test_plain_bodytext_qp_encoding2.txt |
|
137 // |
|
138 select_entry test_plain_bodytext_base64_encoding |
|
139 dump_body_text test_plain_bodytext_base64_encoding.txt |
|
140 // |
|
141 select_entry corrupted_charset_test_plain_bodytext_base64_encoding |
|
142 change_charset 268450576 |
|
143 dump_body_text corrupted_charset_test_plain_bodytext_base64_encoding.txt |
|
144 // |
|
145 // |
|
146 select_entry html_no_encoding_with_attachments |
|
147 dump_body_text html_no_encoding_with_attachments.txt |
|
148 dump_attachment_names attachment_names3.txt |
|
149 // |
|
150 select_entry corrupted_charset_html_no_encoding_with_attachments |
|
151 change_charset 268450576 |
|
152 dump_body_text corrupted_charset_html_no_encoding_with_attachments.txt |
|
153 dump_attachment_names attachment_names4.txt |
|
154 // |
|
155 select_entry html_base64_with_attachment |
|
156 dump_body_text html_base64_with_attachment.txt |
|
157 dump_attachment_names single_attachment_name.txt |
|
158 // |
|
159 select_entry corrupted_charset_html_base64_with_attachment |
|
160 change_charset 268450576 |
|
161 dump_body_text corrupted_charset_html_base64_with_attachment.txt |
|
162 dump_attachment_names single_attachment_name2.txt |
|
163 // |
|
164 // |
|
165 select_entry html_qp_encoding_looking_french |
|
166 change_charset 268450576 |
|
167 dump_body_text html_qp_encoding_bodytext.txt |
|
168 dump_header_fields html_qp_encoding_headers.txt |
|
169 // |
|
170 // Some more attachments.... |
|
171 // |
|
172 select_entry test_attachment1 |
|
173 dump_attachment_names attachment_names.txt |
|
174 // |
|
175 select_entry test_attachment1_corrupted |
|
176 change_charset 268450576 |
|
177 dump_attachment_names attachment_names2.txt |
|
178 // |
|
179 // |
|
180 add_comment Disconnect |
|
181 disconnect |
|
182 check_imap_error 0 |
|
183 |
|
184 |
|
185 [verify_body_text] |
|
186 compare_files plain_text_non_mime.txt plain_text_non_mime.txt |
|
187 compare_files plain_text_non_mime2.txt plain_text_non_mime.txt |
|
188 compare_files test_plain_bodytext_no_encoding.txt test_plain_bodytext_no_encoding.txt |
|
189 compare_files corrupted_charset_test_plain_bodytext_no_encoding.txt test_plain_bodytext_no_encoding.txt |
|
190 compare_files test_plain_bodytext_with_attach_no_encoding.txt test_plain_bodytext_with_attach_no_encoding.txt |
|
191 compare_files corruptd_charset_test_plain_bodytext_with_attach_no_encoding.txt test_plain_bodytext_with_attach_no_encoding.txt |
|
192 compare_files test_plain_bodytext_qp_encoding.txt test_plain_bodytext_qp_encoding.txt |
|
193 compare_files corrupted_charset_test_plain_bodytext_qp_encoding.txt test_plain_bodytext_qp_encoding.txt |
|
194 compare_files corrupted_charset_test_plain_bodytext_qp_encoding2.txt test_plain_bodytext_qp_encoding.txt |
|
195 compare_files test_plain_bodytext_base64_encoding.txt test_plain_bodytext_base64_encoding.txt |
|
196 compare_files corrupted_charset_test_plain_bodytext_base64_encoding.txt test_plain_bodytext_base64_encoding.txt |
|
197 compare_files html_no_encoding_with_attachments.txt html_with_attachments_bodytext.txt |
|
198 compare_files corrupted_charset_html_no_encoding_with_attachments.txt html_with_attachments_bodytext.txt |
|
199 compare_files html_base64_with_attachment.txt html_with_attachments_bodytext.txt |
|
200 compare_files corrupted_charset_html_base64_with_attachment.txt html_with_attachments_bodytext.txt |
|
201 compare_files html_qp_encoding_bodytext.txt html_qp_encoding_bodytext.txt |
|
202 |
|
203 [verify_attachment_names] |
|
204 compare_files attachment_names.txt attachment_names.txt |
|
205 compare_files attachment_names2.txt attachment_names.txt |
|
206 compare_files attachment_names3.txt attachment_names.txt |
|
207 compare_files attachment_names4.txt attachment_names.txt |
|
208 compare_files single_attachment_name.txt single_attachment_name.txt |
|
209 compare_files single_attachment_name2.txt single_attachment_name.txt |
|
210 |
|
211 [verify_header_fields] |
|
212 compare_files html_qp_encoding_headers.txt html_qp_encoding_headers.txt |
|
213 |
|
214 // |
|
215 // mail service definition |
|
216 // |
|
217 [imap_service_MsgExchange] |
|
218 set_name test_imap_service |
|
219 set_server lon-msgtest06.intra |
|
220 set_user santi |
|
221 set_pass password |
|
222 set_tls 0 |
|
223 |
|
224 |