imap-client
Advanced tools
Comparing version 0.11.0 to 0.11.1
{ | ||
"name": "imap-client", | ||
"version": "0.11.0", | ||
"version": "0.11.1", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "pretest": "dir=$(pwd) && cd node_modules/browserbox/node_modules/tcp-socket/node_modules/node-forge/ && npm install && npm run minify && cd $dir", |
@@ -65,4 +65,5 @@ # imap-client | ||
imap.search({ | ||
answered: true | ||
unread: true | ||
answered: true, | ||
unread: true, | ||
header: ['X-Foobar', '123qweasdzxc'] | ||
}, function(error, uids) { | ||
@@ -69,0 +70,0 @@ console.log(‘uids: ‘ + uids.join(‘, ‘)) |
@@ -602,2 +602,3 @@ (function(factory) { | ||
* @param {Boolean} options.unread (optional) Mails with or without the \Seen flag set. | ||
* @param {Array} options.header (optional) Query an arbitrary header, e.g. ['Subject', 'Foobar'], or ['X-Foo', 'bar'] | ||
* | ||
@@ -622,3 +623,3 @@ * @returns {Promise<Array>} Array of uids for messages matching the search terms | ||
// initial request to && (AND) the following properties | ||
// initial request to AND the following properties | ||
query.all = true; | ||
@@ -638,2 +639,6 @@ | ||
if (options.header) { | ||
query.header = options.header; | ||
} | ||
if (options.uid) { | ||
@@ -640,0 +645,0 @@ query.uid = options.uid; |
@@ -30,8 +30,8 @@ 'use strict'; | ||
messages: [{ | ||
raw: 'Message-Id: <abcde>\r\nSubject: hello 1\r\n\r\nWorld 1!' | ||
raw: 'Message-Id: <abcde>\r\nX-Foobar: 123qweasdzxc\r\nSubject: hello 1\r\n\r\nWorld 1!' | ||
}, { | ||
raw: 'Message-Id: <abcde>\r\nSubject: hello 2\r\n\r\nWorld 2!', | ||
raw: 'Message-Id: <qwe>\r\nSubject: hello 2\r\n\r\nWorld 2!', | ||
flags: ['\\Seen'] | ||
}, { | ||
raw: 'Message-Id: <abcde>\r\nSubject: hello 3\r\n\r\nWorld 3!' | ||
raw: 'Message-Id: <asd>\r\nSubject: hello 3\r\n\r\nWorld 3!' | ||
}, { | ||
@@ -143,3 +143,2 @@ raw: 'MIME-Version: 1.0\r\nDate: Tue, 01 Oct 2013 07:08:55 GMT\r\nMessage-Id: <1380611335900.56da46df@Nodemailer>\r\nFrom: alice@example.com\r\nTo: bob@example.com\r\nSubject: Hello\r\nContent-Type: multipart/mixed;\r\n boundary="----Nodemailer-0.5.3-dev-?=_1-1380611336047"\r\n\r\n------Nodemailer-0.5.3-dev-?=_1-1380611336047\r\nContent-Type: text/plain; charset=utf-8\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\nHello world\r\n------Nodemailer-0.5.3-dev-?=_1-1380611336047\r\nContent-Type: text/plain; name="foo.txt"\r\nContent-Disposition: attachment; filename="foo.txt"\r\nContent-Transfer-Encoding: base64\r\n\r\nZm9vZm9vZm9vZm9vZm9v\r\n------Nodemailer-0.5.3-dev-?=_1-1380611336047\r\nContent-Type: text/plain; name="bar.txt"\r\nContent-Disposition: attachment; filename="bar.txt"\r\nContent-Transfer-Encoding: base64\r\n\r\nYmFyYmFyYmFyYmFyYmFy\r\n------Nodemailer-0.5.3-dev-?=_1-1380611336047--' | ||
path: 'INBOX', | ||
subject: 'blablubb', | ||
unread: false, | ||
@@ -152,2 +151,11 @@ answered: false | ||
it('should search messages for header', function(done) { | ||
ic.search({ | ||
path: 'INBOX', | ||
header: ['X-Foobar', '123qweasdzxc'] | ||
}).then(function(uids) { | ||
expect(uids).to.deep.equal([1]); | ||
}).then(done); | ||
}); | ||
it('should list messages by uid', function(done) { | ||
@@ -154,0 +162,0 @@ ic.listMessages({ |
@@ -215,2 +215,16 @@ (function(factory) { | ||
it('should search header', function(done) { | ||
bboxMock.search.withArgs({ | ||
all: true, | ||
header: ['Foo', 'bar'] | ||
}).returns(resolves([1, 3, 5])); | ||
imap.search({ | ||
path: 'foobar', | ||
header: ['Foo', 'bar'] | ||
}).then(function(uids) { | ||
expect(uids.length).to.equal(3); | ||
}).then(done); | ||
}); | ||
it('should search read', function(done) { | ||
@@ -217,0 +231,0 @@ bboxMock.search.withArgs({ |
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
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
101990
2164
226