New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

imapflow

Package Overview
Dependencies
Maintainers
1
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imapflow - npm Package Compare versions

Comparing version 1.0.177 to 1.0.178

lib/charsets.js

2

.ncurc.js
module.exports = {
upgrade: true,
reject: ['jsdoc', 'eslint', 'grunt-eslint']
reject: ['jsdoc', 'eslint', 'grunt-eslint', 'eslint-config-prettier']
};
# Changelog
## [1.0.178](https://github.com/postalsys/imapflow/compare/v1.0.177...v1.0.178) (2025-01-23)
### Bug Fixes
* **bodystructure:** Handle unicode filenames for servers that do not know how to use parameter continuations ([2b4b240](https://github.com/postalsys/imapflow/commit/2b4b2408bf19a337958888f5f2bcdd9af86424c1))
## [1.0.177](https://github.com/postalsys/imapflow/compare/v1.0.176...v1.0.177) (2025-01-17)

@@ -4,0 +11,0 @@

@@ -6,2 +6,3 @@ /* eslint no-control-regex:0 */

const libmime = require('libmime');
const { resolveCharset } = require('./charsets');
const { compiler } = require('./handler/imap-handler');

@@ -511,2 +512,10 @@ const { createHash } = require('crypto');

if (params.filename && !params['filename*'] && /^[a-z\-_0-9]+'[a-z]*'[^'\x00-\x08\x0b\x0c\x0e-\x1f\u0080-\uFFFF]+/.test(params.filename)) {
// seems like encoded value
let [encoding, , encodedValue] = params.filename.split("'");
if (resolveCharset(encoding)) {
params['filename*'] = `${encoding}''${encodedValue}`;
}
}
// preprocess values

@@ -513,0 +522,0 @@ Object.keys(params).forEach(key => {

{
"name": "imapflow",
"version": "1.0.177",
"version": "1.0.178",
"description": "IMAP Client for Node",

@@ -31,7 +31,7 @@ "main": "./lib/imap-flow.js",

"devDependencies": {
"@babel/eslint-parser": "7.25.9",
"@babel/eslint-parser": "7.26.5",
"@babel/eslint-plugin": "7.25.9",
"@babel/plugin-syntax-class-properties": "7.12.13",
"@babel/preset-env": "7.26.0",
"@types/node": "22.10.5",
"@types/node": "22.10.8",
"eslint": "8.57.0",

@@ -56,3 +56,3 @@ "eslint-config-nodemailer": "1.2.0",

"mailsplit": "5.4.2",
"nodemailer": "6.9.16",
"nodemailer": "6.10.0",
"pino": "9.6.0",

@@ -59,0 +59,0 @@ "socks": "2.8.3"

@@ -995,1 +995,139 @@ 'use strict';

};
module.exports['Process non-standard unicode filename property'] = test => {
let attribute = [
[
[
{ type: 'STRING', value: 'text' },
{ type: 'STRING', value: 'plain' },
[
{ type: 'STRING', value: 'charset' },
{ type: 'STRING', value: 'utf-8' }
],
null,
null,
{ type: 'STRING', value: 'quoted-printable' },
{ type: 'ATOM', value: '275385' },
{ type: 'ATOM', value: '3531' },
null,
null,
null,
null
],
[
[
{ type: 'STRING', value: 'text' },
{ type: 'STRING', value: 'html' },
[
{ type: 'STRING', value: 'charset' },
{ type: 'STRING', value: 'utf-8' }
],
null,
null,
{ type: 'STRING', value: 'quoted-printable' },
{ type: 'ATOM', value: '333' },
{ type: 'ATOM', value: '6' },
null,
null,
null,
null
],
[
{ type: 'STRING', value: 'image' },
{ type: 'STRING', value: 'png' },
[
{ type: 'STRING', value: 'name' },
{ type: 'STRING', value: 'image-1.png' }
],
{
type: 'STRING',
value: '<7e1703a0-b8b7-4d00-9193-989506afb76e@emailengine>'
},
null,
{ type: 'STRING', value: 'base64' },
{ type: 'ATOM', value: '271540' },
null,
[
{ type: 'STRING', value: 'inline' },
[
{ type: 'STRING', value: 'filename' },
{ type: 'STRING', value: 'image-1.png' }
]
],
null,
null
],
{ type: 'STRING', value: 'related' },
[
{ type: 'STRING', value: 'type' },
{ type: 'STRING', value: 'text/html' },
{ type: 'STRING', value: 'boundary' },
{
type: 'STRING',
value: '----=_Part-GUieKCU_ZWVAMi40OS43_nvE0TCtGsQo-Part_4'
}
],
null,
null
],
{ type: 'STRING', value: 'alternative' },
[
{ type: 'STRING', value: 'boundary' },
{
type: 'STRING',
value: '----=_Part-GUieKCU_ZWVAMi40OS43_nvE0TCtGsQo-Part_2'
}
],
null,
null
],
[
{ type: 'STRING', value: 'application' },
{
type: 'STRING',
value: 'vnd.openxmlformats-officedocument.spreadsheetml.sheet'
},
[
{ type: 'STRING', value: 'name' },
{
type: 'STRING',
value: '=?UTF-8?Q?Trang=5Fghi=5F=C3=A2m_=288=29_=281=29=2E?= =?UTF-8?Q?xlsx?='
}
],
null,
null,
{ type: 'STRING', value: 'base64' },
{ type: 'ATOM', value: '532006' },
null,
[
{ type: 'STRING', value: 'attachment' },
[
{ type: 'STRING', value: 'filename' },
{
type: 'STRING',
value: "utf-8''Trang_ghi_%C3%A2m%20%288%29%20%281%29.xlsx"
}
]
],
null,
null
],
{ type: 'STRING', value: 'mixed' },
[
{ type: 'STRING', value: 'boundary' },
{
type: 'STRING',
value: '----=_Part-GUieKCU_ZWVAMi40OS43_nvE0TCtGsQo-Part_1'
}
],
null,
null
];
let bodyStruct = parseBodystructure(attribute);
console.log(JSON.stringify(bodyStruct, false, 2));
test.deepEqual(bodyStruct.childNodes[1].dispositionParameters.filename, 'Trang_ghi_âm (8) (1).xlsx');
test.done();
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc