@bobfrankston/iflow-direct 0.1.4 → 0.1.6
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.
- package/imap-protocol.js +3 -1
- package/package.json +1 -1
package/imap-protocol.js
CHANGED
|
@@ -246,7 +246,9 @@ function unquote(s) {
|
|
|
246
246
|
function decodeImapString(s) {
|
|
247
247
|
if (!s)
|
|
248
248
|
return "";
|
|
249
|
-
|
|
249
|
+
// RFC 2047 §6.2: whitespace between adjacent encoded-words must be ignored
|
|
250
|
+
const unfolded = s.replace(/\?=\s+=\?/g, "?==?");
|
|
251
|
+
return unfolded.replace(/=\?([^?]+)\?([BQ])\?([^?]+)\?=/gi, (_match, charset, encoding, text) => {
|
|
250
252
|
try {
|
|
251
253
|
const cs = charset.toLowerCase().replace(/^utf8$/, "utf-8");
|
|
252
254
|
if (encoding.toUpperCase() === "B") {
|