@n8n/imap 0.8.19 → 0.9.0

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 (44) hide show
  1. package/LICENSE.md +88 -0
  2. package/LICENSE_EE.md +27 -0
  3. package/dist/ImapSimple.d.ts +16 -0
  4. package/dist/ImapSimple.js +120 -0
  5. package/dist/ImapSimple.js.map +1 -0
  6. package/dist/PartData.d.ts +24 -0
  7. package/dist/PartData.js +109 -0
  8. package/dist/PartData.js.map +1 -0
  9. package/dist/build.tsbuildinfo +1 -0
  10. package/dist/errors.d.ts +12 -0
  11. package/dist/errors.js +30 -0
  12. package/dist/errors.js.map +1 -0
  13. package/dist/helpers/getMessage.d.ts +3 -0
  14. package/dist/helpers/getMessage.js +37 -0
  15. package/dist/helpers/getMessage.js.map +1 -0
  16. package/dist/index.d.ts +7 -0
  17. package/dist/index.js +85 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/types.d.ts +30 -0
  20. package/dist/types.js +3 -0
  21. package/dist/types.js.map +1 -0
  22. package/package.json +42 -18
  23. package/LICENSE +0 -19
  24. package/README.md +0 -754
  25. package/deps/encoding/encoding-indexes.js +0 -73
  26. package/deps/encoding/encoding.js +0 -2340
  27. package/deps/test/utf7-imap.js +0 -48
  28. package/deps/test/utf7-rfc2152.js +0 -78
  29. package/deps/utf7.js +0 -104
  30. package/index.d.ts +0 -396
  31. package/lib/Connection.js +0 -2131
  32. package/lib/Parser.js +0 -1026
  33. package/test/test-connection-fetch-dup.js +0 -92
  34. package/test/test-connection-fetch-frag.js +0 -92
  35. package/test/test-connection-fetch-spillover.js +0 -176
  36. package/test/test-connection-fetch-stringbody.js +0 -104
  37. package/test/test-connection-idle-normal.js +0 -144
  38. package/test/test-connection-idle-order.js +0 -138
  39. package/test/test-parse-bodystructure.js +0 -83
  40. package/test/test-parse-envelope-addrs.js +0 -117
  41. package/test/test-parse-expr.js +0 -92
  42. package/test/test-parse-header.js +0 -109
  43. package/test/test-parser.js +0 -543
  44. package/test/test.js +0 -4
@@ -1,92 +0,0 @@
1
- var assert = require('assert'),
2
- net = require('net'),
3
- Imap = require('../lib/Connection'),
4
- result;
5
-
6
- var CRLF = '\r\n';
7
-
8
- var RESPONSES = [
9
- ['* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA CHILDREN',
10
- 'A0 OK Thats all she wrote!',
11
- ''
12
- ].join(CRLF),
13
- ['* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA CHILDREN UIDPLUS MOVE',
14
- 'A1 OK authenticated (Success)',
15
- ''
16
- ].join(CRLF),
17
- ['* NAMESPACE (("" "/")) NIL NIL',
18
- 'A2 OK Success',
19
- ''
20
- ].join(CRLF),
21
- ['* LIST (\\Noselect) "/" "/"',
22
- 'A3 OK Success',
23
- ''
24
- ].join(CRLF),
25
- ['* FLAGS (\\Answered \\Flagged \\Draft \\Deleted \\Seen)',
26
- '* OK [PERMANENTFLAGS ()] Flags permitted.',
27
- '* OK [UIDVALIDITY 2] UIDs valid.',
28
- '* 685 EXISTS',
29
- '* 0 RECENT',
30
- '* OK [UIDNEXT 4422] Predicted next UID.',
31
- 'A4 OK [READ-ONLY] INBOX selected. (Success)',
32
- ''
33
- ].join(CRLF),
34
- ['* 1 FETCH (UID 1)',
35
- '* 1 FETCH (INTERNALDATE "05-Sep-2004 00:38:03 +0000" UID 1000)',
36
- '* 1 FETCH (FLAGS (\\Seen))',
37
- 'A5 OK Success',
38
- ''
39
- ].join(CRLF),
40
- ['* BYE LOGOUT Requested',
41
- 'A6 OK good day (Success)',
42
- ''
43
- ].join(CRLF)
44
- ];
45
-
46
- var srv = net.createServer(function(sock) {
47
- sock.write('* OK asdf\r\n');
48
- var buf = '', lines;
49
- sock.on('data', function(data) {
50
- buf += data.toString('utf8');
51
- if (buf.indexOf(CRLF) > -1) {
52
- lines = buf.split(CRLF);
53
- buf = lines.pop();
54
- lines.forEach(function() {
55
- sock.write(RESPONSES.shift());
56
- });
57
- }
58
- });
59
- });
60
- srv.listen(0, '127.0.0.1', function() {
61
- var port = srv.address().port;
62
- var imap = new Imap({
63
- user: 'foo',
64
- password: 'bar',
65
- host: '127.0.0.1',
66
- port: port,
67
- keepalive: false
68
- });
69
- imap.on('ready', function() {
70
- imap.openBox('INBOX', true, function() {
71
- var f = imap.seq.fetch(1);
72
- f.on('message', function(m) {
73
- m.once('attributes', function(attrs) {
74
- result = attrs;
75
- });
76
- });
77
- f.on('end', function() {
78
- srv.close();
79
- imap.end();
80
- });
81
- });
82
- });
83
- imap.connect();
84
- });
85
-
86
- process.once('exit', function() {
87
- assert.deepEqual(result, {
88
- uid: 1,
89
- date: new Date('05-Sep-2004 00:38:03 +0000'),
90
- flags: [ '\\Seen' ]
91
- });
92
- });
@@ -1,92 +0,0 @@
1
- var assert = require('assert'),
2
- net = require('net'),
3
- Imap = require('../lib/Connection'),
4
- result;
5
-
6
- var CRLF = '\r\n';
7
-
8
- var RESPONSES = [
9
- ['* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA CHILDREN',
10
- 'A0 OK Thats all she wrote!',
11
- ''
12
- ].join(CRLF),
13
- ['* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA CHILDREN UIDPLUS MOVE',
14
- 'A1 OK authenticated (Success)',
15
- ''
16
- ].join(CRLF),
17
- ['* NAMESPACE (("" "/")) NIL NIL',
18
- 'A2 OK Success',
19
- ''
20
- ].join(CRLF),
21
- ['* LIST (\\Noselect) "/" "/"',
22
- 'A3 OK Success',
23
- ''
24
- ].join(CRLF),
25
- ['* FLAGS (\\Answered \\Flagged \\Draft \\Deleted \\Seen)',
26
- '* OK [PERMANENTFLAGS ()] Flags permitted.',
27
- '* OK [UIDVALIDITY 2] UIDs valid.',
28
- '* 685 EXISTS',
29
- '* 0 RECENT',
30
- '* OK [UIDNEXT 4422] Predicted next UID.',
31
- 'A4 OK [READ-ONLY] INBOX selected. (Success)',
32
- ''
33
- ].join(CRLF),
34
- ['* 1 FETCH (UID 1)',
35
- '* 1 FETCH (INTERNALDATE "05-Sep-2004 00:38:03 +0000")',
36
- '* 1 FETCH (FLAGS (\\Seen))',
37
- 'A5 OK Success',
38
- ''
39
- ].join(CRLF),
40
- ['* BYE LOGOUT Requested',
41
- 'A6 OK good day (Success)',
42
- ''
43
- ].join(CRLF)
44
- ];
45
-
46
- var srv = net.createServer(function(sock) {
47
- sock.write('* OK asdf\r\n');
48
- var buf = '', lines;
49
- sock.on('data', function(data) {
50
- buf += data.toString('utf8');
51
- if (buf.indexOf(CRLF) > -1) {
52
- lines = buf.split(CRLF);
53
- buf = lines.pop();
54
- lines.forEach(function() {
55
- sock.write(RESPONSES.shift());
56
- });
57
- }
58
- });
59
- });
60
- srv.listen(0, '127.0.0.1', function() {
61
- var port = srv.address().port;
62
- var imap = new Imap({
63
- user: 'foo',
64
- password: 'bar',
65
- host: '127.0.0.1',
66
- port: port,
67
- keepalive: false
68
- });
69
- imap.on('ready', function() {
70
- imap.openBox('INBOX', true, function() {
71
- var f = imap.seq.fetch(1);
72
- f.on('message', function(m) {
73
- m.once('attributes', function(attrs) {
74
- result = attrs;
75
- });
76
- });
77
- f.on('end', function() {
78
- srv.close();
79
- imap.end();
80
- });
81
- });
82
- });
83
- imap.connect();
84
- });
85
-
86
- process.once('exit', function() {
87
- assert.deepEqual(result, {
88
- uid: 1,
89
- date: new Date('05-Sep-2004 00:38:03 +0000'),
90
- flags: [ '\\Seen' ]
91
- });
92
- });
@@ -1,176 +0,0 @@
1
- // Test for _at least_ GH Issues #345, #379, #392, #411
2
-
3
- var assert = require('assert'),
4
- net = require('net'),
5
- crypto = require('crypto'),
6
- Imap = require('../lib/Connection');
7
-
8
- var result = [],
9
- body = [],
10
- bodyInfo = [];
11
-
12
- var CRLF = '\r\n';
13
-
14
- // generate data larger than highWaterMark
15
- var bytes = crypto.pseudoRandomBytes(10240).toString('hex');
16
-
17
- var RESPONSES = [
18
- ['* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA CHILDREN',
19
- 'A0 OK Thats all she wrote!',
20
- ''
21
- ].join(CRLF),
22
- ['* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA CHILDREN UIDPLUS MOVE',
23
- 'A1 OK authenticated (Success)',
24
- ''
25
- ].join(CRLF),
26
- ['* NAMESPACE (("" "/")) NIL NIL',
27
- 'A2 OK Success',
28
- ''
29
- ].join(CRLF),
30
- ['* LIST (\\Noselect) "/" "/"',
31
- 'A3 OK Success',
32
- ''
33
- ].join(CRLF),
34
- ['* FLAGS (\\Answered \\Flagged \\Draft \\Deleted \\Seen)',
35
- '* OK [PERMANENTFLAGS ()] Flags permitted.',
36
- '* OK [UIDVALIDITY 2] UIDs valid.',
37
- '* 685 EXISTS',
38
- '* 0 RECENT',
39
- '* OK [UIDNEXT 4422] Predicted next UID.',
40
- 'A4 OK [READ-ONLY] INBOX selected. (Success)',
41
- ''
42
- ].join(CRLF),
43
- '* 1 FETCH (UID 1000 FLAGS (\\Seen) INTERNALDATE "05-Sep-2004 00:38:03 +0000" BODY[TEXT] {'
44
- + bytes.length
45
- + '}'
46
- + CRLF
47
- + bytes.substring(0, 20000),
48
- ['* BYE LOGOUT Requested',
49
- 'A6 OK good day (Success)',
50
- ''
51
- ].join(CRLF)
52
- ];
53
- var EXPECTED = [
54
- 'A0 CAPABILITY',
55
- 'A1 LOGIN "foo" "bar"',
56
- 'A2 NAMESPACE',
57
- 'A3 LIST "" ""',
58
- 'A4 EXAMINE "INBOX"',
59
- 'A5 FETCH 1,2 (UID FLAGS INTERNALDATE BODY.PEEK[TEXT])',
60
- 'A6 LOGOUT'
61
- ];
62
-
63
- var exp = -1,
64
- res = -1;
65
-
66
- var srv = net.createServer(function(sock) {
67
- sock.write('* OK asdf\r\n');
68
- var buf = '', lines;
69
- sock.on('data', function(data) {
70
- buf += data.toString('utf8');
71
- if (buf.indexOf(CRLF) > -1) {
72
- lines = buf.split(CRLF);
73
- buf = lines.pop();
74
- lines.forEach(function(l) {
75
- assert(l === EXPECTED[++exp], 'Unexpected client request: ' + l);
76
- assert(RESPONSES[++res], 'No response for client request: ' + l);
77
- sock.write(RESPONSES[res]);
78
- });
79
- }
80
- });
81
- });
82
- srv.listen(0, '127.0.0.1', function() {
83
- var port = srv.address().port;
84
- var imap = new Imap({
85
- user: 'foo',
86
- password: 'bar',
87
- host: '127.0.0.1',
88
- port: port,
89
- keepalive: false
90
- });
91
- imap.on('ready', function() {
92
- srv.close();
93
- imap.openBox('INBOX', true, function() {
94
- var f = imap.seq.fetch([1,2], { bodies: ['TEXT'] });
95
- var nbody = -1;
96
- f.on('message', function(m) {
97
- m.on('body', function(stream, info) {
98
- ++nbody;
99
- bodyInfo.push(info);
100
- body[nbody] = '';
101
- if (nbody === 0) {
102
- // first allow body.push() to return false in parser.js
103
- setTimeout(function() {
104
- stream.on('data', function(chunk) {
105
- body[nbody] += chunk.toString('latin1');
106
- });
107
- setTimeout(function() {
108
- var oldRead = stream._read,
109
- readCalled = false;
110
- stream._read = function(n) {
111
- readCalled = true;
112
- stream._read = oldRead;
113
- imap._sock.push(bytes.substring(100, 200)
114
- + ')'
115
- + CRLF
116
- + 'A5 OK Success'
117
- + CRLF);
118
- imap._parser._tryread();
119
- };
120
- imap._sock.push(bytes.substring(20000)
121
- + ')'
122
- + CRLF
123
- + '* 2 FETCH (UID 1001 FLAGS (\\Seen) INTERNALDATE "05-Sep-2004 00:38:13 +0000" BODY[TEXT] {200}'
124
- + CRLF
125
- + bytes.substring(0, 100));
126
-
127
- // if we got this far, then we didn't get an exception and we
128
- // are running with the bug fix in place
129
- if (!readCalled) {
130
- imap._sock.push(bytes.substring(100, 200)
131
- + ')'
132
- + CRLF
133
- + 'A5 OK Success'
134
- + CRLF);
135
- }
136
- }, 100);
137
- }, 100);
138
- } else {
139
- stream.on('data', function(chunk) {
140
- body[nbody] += chunk.toString('latin1');
141
- });
142
- }
143
- });
144
- m.on('attributes', function(attrs) {
145
- result.push(attrs);
146
- });
147
- });
148
- f.on('end', function() {
149
- imap.end();
150
- });
151
- });
152
- });
153
- imap.connect();
154
- });
155
-
156
- process.once('exit', function() {
157
- assert.deepEqual(result, [{
158
- uid: 1000,
159
- date: new Date('05-Sep-2004 00:38:03 +0000'),
160
- flags: [ '\\Seen' ]
161
- }, {
162
- uid: 1001,
163
- date: new Date('05-Sep-2004 00:38:13 +0000'),
164
- flags: [ '\\Seen' ]
165
- }]);
166
- assert.deepEqual(body, [bytes, bytes.substring(0, 200)]);
167
- assert.deepEqual(bodyInfo, [{
168
- seqno: 1,
169
- which: 'TEXT',
170
- size: bytes.length
171
- }, {
172
- seqno: 2,
173
- which: 'TEXT',
174
- size: 200
175
- }]);
176
- });
@@ -1,104 +0,0 @@
1
- var assert = require('assert'),
2
- net = require('net'),
3
- Imap = require('../lib/Connection');
4
-
5
- var result, body = '', bodyInfo;
6
-
7
- var CRLF = '\r\n';
8
-
9
- var RESPONSES = [
10
- ['* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA CHILDREN',
11
- 'A0 OK Thats all she wrote!',
12
- ''
13
- ].join(CRLF),
14
- ['* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA CHILDREN UIDPLUS MOVE',
15
- 'A1 OK authenticated (Success)',
16
- ''
17
- ].join(CRLF),
18
- ['* NAMESPACE (("" "/")) NIL NIL',
19
- 'A2 OK Success',
20
- ''
21
- ].join(CRLF),
22
- ['* LIST (\\Noselect) "/" "/"',
23
- 'A3 OK Success',
24
- ''
25
- ].join(CRLF),
26
- ['* FLAGS (\\Answered \\Flagged \\Draft \\Deleted \\Seen)',
27
- '* OK [PERMANENTFLAGS ()] Flags permitted.',
28
- '* OK [UIDVALIDITY 2] UIDs valid.',
29
- '* 685 EXISTS',
30
- '* 0 RECENT',
31
- '* OK [UIDNEXT 4422] Predicted next UID.',
32
- 'A4 OK [READ-ONLY] INBOX selected. (Success)',
33
- ''
34
- ].join(CRLF),
35
- ['* 1 FETCH (UID 1)',
36
- '* 1 FETCH (INTERNALDATE "05-Sep-2004 00:38:03 +0000" UID 1000)',
37
- '* 1 FETCH (BODY[TEXT] "IMAP is terrible")',
38
- '* 1 FETCH (FLAGS (\\Seen))',
39
- 'A5 OK Success',
40
- ''
41
- ].join(CRLF),
42
- ['* BYE LOGOUT Requested',
43
- 'A6 OK good day (Success)',
44
- ''
45
- ].join(CRLF)
46
- ];
47
-
48
- var srv = net.createServer(function(sock) {
49
- sock.write('* OK asdf\r\n');
50
- var buf = '', lines;
51
- sock.on('data', function(data) {
52
- buf += data.toString('utf8');
53
- if (buf.indexOf(CRLF) > -1) {
54
- lines = buf.split(CRLF);
55
- buf = lines.pop();
56
- lines.forEach(function() {
57
- sock.write(RESPONSES.shift());
58
- });
59
- }
60
- });
61
- });
62
- srv.listen(0, '127.0.0.1', function() {
63
- var port = srv.address().port;
64
- var imap = new Imap({
65
- user: 'foo',
66
- password: 'bar',
67
- host: '127.0.0.1',
68
- port: port,
69
- keepalive: false
70
- });
71
- imap.on('ready', function() {
72
- imap.openBox('INBOX', true, function() {
73
- var f = imap.seq.fetch(1, { bodies: ['TEXT'] });
74
- f.on('message', function(m) {
75
- m.on('body', function(stream, info) {
76
- bodyInfo = info;
77
- stream.on('data', function(chunk) { body += chunk.toString('utf8'); });
78
- });
79
- m.on('attributes', function(attrs) {
80
- result = attrs;
81
- });
82
- });
83
- f.on('end', function() {
84
- srv.close();
85
- imap.end();
86
- });
87
- });
88
- });
89
- imap.connect();
90
- });
91
-
92
- process.once('exit', function() {
93
- assert.deepEqual(result, {
94
- uid: 1,
95
- date: new Date('05-Sep-2004 00:38:03 +0000'),
96
- flags: [ '\\Seen' ]
97
- });
98
- assert.equal(body, 'IMAP is terrible');
99
- assert.deepEqual(bodyInfo, {
100
- seqno: 1,
101
- which: 'TEXT',
102
- size: 16
103
- });
104
- });
@@ -1,144 +0,0 @@
1
- var assert = require('assert'),
2
- net = require('net'),
3
- Imap = require('../lib/Connection');
4
-
5
- var result, body = '', bodyInfo;
6
-
7
- var CRLF = '\r\n';
8
-
9
- var RESPONSES = [
10
- ['* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA CHILDREN',
11
- 'A0 OK Thats all she wrote!',
12
- ''
13
- ].join(CRLF),
14
- ['* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA CHILDREN UIDPLUS MOVE',
15
- 'A1 OK authenticated (Success)',
16
- ''
17
- ].join(CRLF),
18
- ['* NAMESPACE (("" "/")) NIL NIL',
19
- 'A2 OK Success',
20
- ''
21
- ].join(CRLF),
22
- ['* LIST (\\Noselect) "/" "/"',
23
- 'A3 OK Success',
24
- ''
25
- ].join(CRLF),
26
- ['* FLAGS (\\Answered \\Flagged \\Draft \\Deleted \\Seen)',
27
- '* OK [PERMANENTFLAGS ()] Flags permitted.',
28
- '* OK [UIDVALIDITY 2] UIDs valid.',
29
- '* 685 EXISTS',
30
- '* 0 RECENT',
31
- '* OK [UIDNEXT 4422] Predicted next UID.',
32
- 'A4 OK [READ-ONLY] INBOX selected. (Success)',
33
- ''
34
- ].join(CRLF),
35
- ['* 1 FETCH (UID 1)',
36
- '* 1 FETCH (INTERNALDATE "05-Sep-2004 00:38:03 +0000" UID 1000)',
37
- '* 1 FETCH (BODY[TEXT] "IMAP is terrible")',
38
- '* 1 FETCH (FLAGS (\\Seen))',
39
- 'A5 OK Success',
40
- ''
41
- ].join(CRLF),
42
- ['* STATUS test (MESSAGES 231 RECENT 0 UNSEEN 0 UIDVALIDITY 123 UIDNEXT 442)',
43
- 'A6 OK STATUS completed',
44
- ''
45
- ].join(CRLF),
46
- ['* BYE LOGOUT Requested',
47
- 'A7 OK good day (Success)',
48
- ''
49
- ].join(CRLF)
50
- ];
51
- var EXPECTED = [
52
- 'A0 CAPABILITY',
53
- 'A1 LOGIN "foo" "bar"',
54
- 'A2 NAMESPACE',
55
- 'A3 LIST "" ""',
56
- 'A4 EXAMINE "INBOX"',
57
- 'A5 FETCH 1 (UID FLAGS INTERNALDATE BODY.PEEK[TEXT])',
58
- 'IDLE IDLE',
59
- 'DONE',
60
- 'A6 STATUS "test" (MESSAGES RECENT UNSEEN UIDVALIDITY UIDNEXT)',
61
- 'A7 LOGOUT'
62
- ];
63
-
64
- var exp = -1,
65
- res = -1,
66
- sentCont = false;
67
-
68
- var srv = net.createServer(function(sock) {
69
- sock.write('* OK asdf\r\n');
70
- var buf = '', lines;
71
- sock.on('data', function(data) {
72
- buf += data.toString('utf8');
73
- if (buf.indexOf(CRLF) > -1) {
74
- lines = buf.split(CRLF);
75
- buf = lines.pop();
76
- lines.forEach(function(l) {
77
- assert(l === EXPECTED[++exp], 'Unexpected client request: ' + l);
78
- if (l === 'DONE') {
79
- assert(sentCont, 'DONE seen before continuation sent');
80
- sock.write('IDLE ok\r\n');
81
- } else if (l === 'IDLE IDLE') {
82
- setTimeout(function() {
83
- sentCont = true;
84
- sock.write('+ idling\r\n');
85
- }, 100);
86
- } else {
87
- assert(RESPONSES[++res], 'No response for client request: ' + l);
88
- sock.write(RESPONSES[res]);
89
- }
90
- });
91
- }
92
- });
93
- });
94
- srv.listen(0, '127.0.0.1', function() {
95
- var port = srv.address().port;
96
- var imap = new Imap({
97
- user: 'foo',
98
- password: 'bar',
99
- host: '127.0.0.1',
100
- port: port,
101
- keepalive: true
102
- });
103
- imap.on('ready', function() {
104
- srv.close();
105
- imap.openBox('INBOX', true, function() {
106
- var f = imap.seq.fetch(1, { bodies: ['TEXT'] });
107
- f.on('message', function(m) {
108
- m.on('body', function(stream, info) {
109
- bodyInfo = info;
110
- stream.on('data', function(chunk) { body += chunk.toString('utf8'); });
111
- });
112
- m.on('attributes', function(attrs) {
113
- result = attrs;
114
- });
115
- });
116
- f.on('end', function() {
117
- setTimeout(function() {
118
- var timeout = setTimeout(function() {
119
- assert(false, 'Timed out waiting for STATUS');
120
- }, 500);
121
- imap.status('test', function(err, status) {
122
- clearTimeout(timeout);
123
- imap.end();
124
- });
125
- }, 500);
126
- });
127
- });
128
- });
129
- imap.connect();
130
- });
131
-
132
- process.once('exit', function() {
133
- assert.deepEqual(result, {
134
- uid: 1,
135
- date: new Date('05-Sep-2004 00:38:03 +0000'),
136
- flags: [ '\\Seen' ]
137
- });
138
- assert.equal(body, 'IMAP is terrible');
139
- assert.deepEqual(bodyInfo, {
140
- seqno: 1,
141
- which: 'TEXT',
142
- size: 16
143
- });
144
- });