Node Imap cannot change seen to unseen for office 365

176 Views Asked by At

I am trying to update flag of a email message from offcie 365 account from 'seen' to 'unseen' using node imap. I don't get any error but the message still remains seen. Same code works for Gmail. Similar logic works for office 365 for flagging a message with 'flag' and to mark message as 'seen'.

Any idea why 'seen' to 'unseen' doesn't works for Office ? Below is my code snippet

imap.setFlags(seqno, 'UNSEEN', function(err) { //Tried Unseen, unseen etc..
              if (err) return err;
              imap.closeBox(function(err) {
                if (err) return err;
                imap.logout();
              });
            }); 
1

There are 1 best solutions below

0
Rajjy On

As mentioned by Max, 'delFlags' works out. But wondering why setting flag to 'unseen' doesn't work for Office365.