Socket
Socket
Sign inDemoInstall

emailjs-imap-handler

Package Overview
Dependencies
0
Maintainers
3
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

.vscode/.browse.VC.db

2

package.json
{
"name": "emailjs-imap-handler",
"main": "src/emailjs-imap-handler.js",
"version": "1.0.1",
"version": "1.0.2",
"homepage": "https://github.com/emailjs/emailjs-imap-handler",

@@ -6,0 +6,0 @@ "author": "Andris Reinman <andris@kreata.ee>",

@@ -419,7 +419,3 @@ // Copyright (c) 2013 Andris Reinman

// [ starts a section group for this element
if (chr === '[') {
// allowed only for selected elements
if (['BODY', 'BODY.PEEK'].indexOf(this.currentNode.value.toUpperCase()) < 0) {
throw new Error('Unexpected section start char [ at position ' + this.pos);
}
if (chr === '[' && ['BODY', 'BODY.PEEK'].indexOf(this.currentNode.value.toUpperCase()) >= 0) {
this.currentNode.endPos = this.pos + i;

@@ -426,0 +422,0 @@ this.currentNode = this.createNode(this.currentNode.parentNode, this.pos + i);

@@ -197,2 +197,65 @@ (function(root, factory) {

// The following 4 tests are added as part of solution and verification
// of https://github.com/emailjs/emailjs-imap-handler/issues/16
// See tools.ietf.org/html/rfc3501 and especially chapters:
// * 5.1. Mailbox Naming
// * 5.1.1. Mailbox Hierarchy Naming
describe('Mailbox names with brackets', function() {
describe('for server with / as hierarchical separator', function() {
it('should support Parent folder being in brackets', function() {
expect(imapHandler.parser('TAG1 CMD "/" [Folder]/Subfolder').attributes).to.deep.equal([
{
type: 'STRING',
value: '/'
},
{
type: 'ATOM',
value: '[Folder]/Subfolder'
}
]);
});
it('should support sub-folder being in brackets', function() {
expect(imapHandler.parser('TAG1 CMD "/" Folder/[Subfolder]').attributes).to.deep.equal([
{
type: 'STRING',
value: '/'
},
{
type: 'ATOM',
value: 'Folder/[Subfolder]'
}
]);
});
});
describe('for server with . as hierarchical separator', function() {
it('should support Parent folder being in brackets', function() {
expect(imapHandler.parser('TAG1 CMD "." [Folder].Subfolder').attributes).to.deep.equal([
{
type: 'STRING',
value: '.'
},
{
type: 'ATOM',
value: '[Folder].Subfolder'
}
]);
});
it('should support sub-folder being in brackets', function() {
expect(imapHandler.parser('TAG1 CMD "." Folder.[Subfolder]').attributes).to.deep.equal([
{
type: 'STRING',
value: '.'
},
{
type: 'ATOM',
value: 'Folder.[Subfolder]'
}
]);
});
});
});
describe('get list', function() {

@@ -376,6 +439,2 @@ it('should succeed', function() {

});
it('should fail where default BODY and BODY.PEEK are allowed to have sections', function() {});
expect(function() {
imapHandler.parser('TAG1 CMD KODY[]');
}).to.throw(Error);
});

@@ -382,0 +441,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc