@bobfrankston/iflow-direct 0.1.4 → 0.1.5

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.
Files changed (2) hide show
  1. package/imap-protocol.js +3 -1
  2. 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
- return s.replace(/=\?([^?]+)\?([BQ])\?([^?]+)\?=/gi, (_match, charset, encoding, text) => {
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") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/iflow-direct",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Direct IMAP client — transport-agnostic, no Node.js dependencies, browser-ready",
5
5
  "main": "index.js",
6
6
  "types": "index.ts",