mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Fix for IMAP node - inbox 0 error.
This commit is contained in:
parent
0b516a83db
commit
2a0491542d
@ -57,7 +57,7 @@ function ImapNode(n) {
|
||||
imap.once('ready', function() {
|
||||
var pay = {};
|
||||
openInbox(function(err, box) {
|
||||
//if (err) throw err;
|
||||
if (box.messages.total > 0) {
|
||||
var f = imap.seq.fetch(box.messages.total + ':*', { bodies: ['HEADER.FIELDS (FROM SUBJECT DATE)','TEXT'] });
|
||||
f.on('message', function(msg, seqno) {
|
||||
node.log('message: #'+ seqno);
|
||||
@ -102,6 +102,11 @@ function ImapNode(n) {
|
||||
else { node.log('duplicate not sent: '+pay.topic); }
|
||||
imap.end();
|
||||
});
|
||||
}
|
||||
else {
|
||||
// node.log("you have achieved inbox zero");
|
||||
imap.end();
|
||||
}
|
||||
});
|
||||
});
|
||||
imap.connect();
|
||||
|
Loading…
Reference in New Issue
Block a user