imapflow 1.0.171 → 1.0.173

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1006,7 +1006,6 @@ module.exports['IMAP Parser, subfolder square bracket'] = test =>
1006
1006
  module.exports['IMAP Parser, FETCH with full range'] = test =>
1007
1007
  asyncWrapper(test, async test => {
1008
1008
  let parsed = await parser('* 32 FETCH (UID 32 RFC822.SIZE 3991 BODY[2.MIME] "(* 61B literal *)" BODY[2]<0.65536> "(* 6B literal *)")');
1009
- console.log(JSON.stringify(parsed.attributes));
1010
1009
  test.deepEqual(parsed.attributes, [
1011
1010
  {
1012
1011
  type: 'ATOM',
@@ -1061,3 +1060,180 @@ module.exports['IMAP Parser, FETCH with full range'] = test =>
1061
1060
  ]
1062
1061
  ]);
1063
1062
  });
1063
+
1064
+ module.exports['IMAP Parser, FETCH with BODYSTRUCTURE'] = test =>
1065
+ asyncWrapper(test, async test => {
1066
+ let parsed = await parser(
1067
+ '* 1013 FETCH (UID 2986 MODSEQ (4960) BODYSTRUCTURE (("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 16 1 NIL NIL NIL NIL)("message" "rfc822" ("name" "Tellimuse Microsoft 365 Business Standard arve vaatamine.eml") NIL NIL "7bit" 370684 ("Mon, 16 Dec 2024 03:28:28 +0000" "Tellimuse Microsoft 365 Business Standard arve vaatamine" (("Microsoft" NIL "microsoft-noreply" "microsoft.com")) (("Microsoft" NIL "microsoft-noreply" "microsoft.com")) (("Microsoft" NIL "microsoft-noreply" "microsoft.com")) ((NIL NIL "andris.reinman" "gmail.com")) NIL NIL NIL "<58710631-775f-4c07-96ff-28a776f44d90@az.eastus2.microsoft.com>") ((("text" "plain" ("charset" "utf-8") NIL NIL "quoted-printable" 2866 80 NIL NIL NIL NIL)("text" "html" ("charset" "utf-8") NIL NIL "quoted-printable" 78392 1770 NIL NIL NIL NIL) "alternative" ("boundary" "=-EcWGOW6mwE+0T4lm385OWw==") NIL NIL NIL)("application" "octet-stream" ("name" "52482541500.pdf") NIL NIL "base64" 279430 NIL ("attachment" ("filename" "52482541500.pdf")) NIL NIL) "mixed" ("boundary" "=-1wJq2CLBJ6H+Zk2GPX9FKw==") NIL NIL NIL) 5580 NIL ("attachment" ("filename" "Tellimuse Microsoft 365 Business Standard arve vaatamine.eml")) NIL NIL) "mixed" ("boundary" "Apple-Mail=_F700EE9B-43B1-4EF1-95EE-CAA13391B333") NIL NIL NIL))'
1068
+ );
1069
+
1070
+ test.deepEqual(parsed.attributes, [
1071
+ { type: 'ATOM', value: 'FETCH' },
1072
+ [
1073
+ { type: 'ATOM', value: 'UID' },
1074
+ { type: 'ATOM', value: '2986' },
1075
+ { type: 'ATOM', value: 'MODSEQ' },
1076
+ [{ type: 'ATOM', value: '4960' }],
1077
+ { type: 'ATOM', value: 'BODYSTRUCTURE' },
1078
+ [
1079
+ [
1080
+ { type: 'STRING', value: 'text' },
1081
+ { type: 'STRING', value: 'plain' },
1082
+ [
1083
+ { type: 'STRING', value: 'charset' },
1084
+ { type: 'STRING', value: 'us-ascii' }
1085
+ ],
1086
+ null,
1087
+ null,
1088
+ { type: 'STRING', value: '7bit' },
1089
+ { type: 'ATOM', value: '16' },
1090
+ { type: 'ATOM', value: '1' },
1091
+ null,
1092
+ null,
1093
+ null,
1094
+ null
1095
+ ],
1096
+ [
1097
+ { type: 'STRING', value: 'message' },
1098
+ { type: 'STRING', value: 'rfc822' },
1099
+ [
1100
+ { type: 'STRING', value: 'name' },
1101
+ { type: 'STRING', value: 'Tellimuse Microsoft 365 Business Standard arve vaatamine.eml' }
1102
+ ],
1103
+ null,
1104
+ null,
1105
+ { type: 'STRING', value: '7bit' },
1106
+ { type: 'ATOM', value: '370684' },
1107
+ [
1108
+ { type: 'STRING', value: 'Mon, 16 Dec 2024 03:28:28 +0000' },
1109
+ { type: 'STRING', value: 'Tellimuse Microsoft 365 Business Standard arve vaatamine' },
1110
+ [
1111
+ [
1112
+ { type: 'STRING', value: 'Microsoft' },
1113
+ null,
1114
+ { type: 'STRING', value: 'microsoft-noreply' },
1115
+ { type: 'STRING', value: 'microsoft.com' }
1116
+ ]
1117
+ ],
1118
+ [
1119
+ [
1120
+ { type: 'STRING', value: 'Microsoft' },
1121
+ null,
1122
+ { type: 'STRING', value: 'microsoft-noreply' },
1123
+ { type: 'STRING', value: 'microsoft.com' }
1124
+ ]
1125
+ ],
1126
+ [
1127
+ [
1128
+ { type: 'STRING', value: 'Microsoft' },
1129
+ null,
1130
+ { type: 'STRING', value: 'microsoft-noreply' },
1131
+ { type: 'STRING', value: 'microsoft.com' }
1132
+ ]
1133
+ ],
1134
+ [[null, null, { type: 'STRING', value: 'andris.reinman' }, { type: 'STRING', value: 'gmail.com' }]],
1135
+ null,
1136
+ null,
1137
+ null,
1138
+ { type: 'STRING', value: '<58710631-775f-4c07-96ff-28a776f44d90@az.eastus2.microsoft.com>' }
1139
+ ],
1140
+ [
1141
+ [
1142
+ [
1143
+ { type: 'STRING', value: 'text' },
1144
+ { type: 'STRING', value: 'plain' },
1145
+ [
1146
+ { type: 'STRING', value: 'charset' },
1147
+ { type: 'STRING', value: 'utf-8' }
1148
+ ],
1149
+ null,
1150
+ null,
1151
+ { type: 'STRING', value: 'quoted-printable' },
1152
+ { type: 'ATOM', value: '2866' },
1153
+ { type: 'ATOM', value: '80' },
1154
+ null,
1155
+ null,
1156
+ null,
1157
+ null
1158
+ ],
1159
+ [
1160
+ { type: 'STRING', value: 'text' },
1161
+ { type: 'STRING', value: 'html' },
1162
+ [
1163
+ { type: 'STRING', value: 'charset' },
1164
+ { type: 'STRING', value: 'utf-8' }
1165
+ ],
1166
+ null,
1167
+ null,
1168
+ { type: 'STRING', value: 'quoted-printable' },
1169
+ { type: 'ATOM', value: '78392' },
1170
+ { type: 'ATOM', value: '1770' },
1171
+ null,
1172
+ null,
1173
+ null,
1174
+ null
1175
+ ],
1176
+ { type: 'STRING', value: 'alternative' },
1177
+ [
1178
+ { type: 'STRING', value: 'boundary' },
1179
+ { type: 'STRING', value: '=-EcWGOW6mwE+0T4lm385OWw==' }
1180
+ ],
1181
+ null,
1182
+ null,
1183
+ null
1184
+ ],
1185
+ [
1186
+ { type: 'STRING', value: 'application' },
1187
+ { type: 'STRING', value: 'octet-stream' },
1188
+ [
1189
+ { type: 'STRING', value: 'name' },
1190
+ { type: 'STRING', value: '52482541500.pdf' }
1191
+ ],
1192
+ null,
1193
+ null,
1194
+ { type: 'STRING', value: 'base64' },
1195
+ { type: 'ATOM', value: '279430' },
1196
+ null,
1197
+ [
1198
+ { type: 'STRING', value: 'attachment' },
1199
+ [
1200
+ { type: 'STRING', value: 'filename' },
1201
+ { type: 'STRING', value: '52482541500.pdf' }
1202
+ ]
1203
+ ],
1204
+ null,
1205
+ null
1206
+ ],
1207
+ { type: 'STRING', value: 'mixed' },
1208
+ [
1209
+ { type: 'STRING', value: 'boundary' },
1210
+ { type: 'STRING', value: '=-1wJq2CLBJ6H+Zk2GPX9FKw==' }
1211
+ ],
1212
+ null,
1213
+ null,
1214
+ null
1215
+ ],
1216
+ { type: 'ATOM', value: '5580' },
1217
+ null,
1218
+ [
1219
+ { type: 'STRING', value: 'attachment' },
1220
+ [
1221
+ { type: 'STRING', value: 'filename' },
1222
+ { type: 'STRING', value: 'Tellimuse Microsoft 365 Business Standard arve vaatamine.eml' }
1223
+ ]
1224
+ ],
1225
+ null,
1226
+ null
1227
+ ],
1228
+ { type: 'STRING', value: 'mixed' },
1229
+ [
1230
+ { type: 'STRING', value: 'boundary' },
1231
+ { type: 'STRING', value: 'Apple-Mail=_F700EE9B-43B1-4EF1-95EE-CAA13391B333' }
1232
+ ],
1233
+ null,
1234
+ null,
1235
+ null
1236
+ ]
1237
+ ]
1238
+ ]);
1239
+ });