1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

let email node mark mail as read

(for the ones it reads)
This commit is contained in:
dceejay 2015-02-26 14:17:44 +00:00
parent a8b3cbb683
commit 131adb6f4e

View File

@ -170,9 +170,9 @@ module.exports = function(RED) {
imap.once('ready', function() {
node.status({fill:"blue",shape:"dot",text:"fetching"});
var pay = {};
imap.openBox('INBOX', true, function(err, box) {
imap.openBox('INBOX', false, function(err, box) {
if (box.messages.total > 0) {
var f = imap.seq.fetch(box.messages.total + ':*', { bodies: ['HEADER.FIELDS (FROM SUBJECT DATE)','TEXT'] });
var f = imap.seq.fetch(box.messages.total + ':*', { markSeen:true, bodies: ['HEADER.FIELDS (FROM SUBJECT DATE)','TEXT'] });
f.on('message', function(msg, seqno) {
node.log('message: #'+ seqno);
var prefix = '(#' + seqno + ') ';