emailjs-imap-handler
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
272895
16
4091
1