Closed waterdrop01 closed 1 year ago
Are you sure seqno
is the correct sequence number for the message you're checking and not a UID or something like that?
Thanks @mscdex for your help!
Pretty sure because I'm currently using the exact same code for 4 different providers. It works perfect for all except for Outlook.
But in doubt I tried to mark as read a sequence of seqno (box object says there are 408 messages):
imap.addFlags(['390:407'], 'SEEN')
And when verifying in the browser webapp, refreshing, not a single mail was marked as read.
Note: I updated the connection code aboce, as I previously pasted nodemailer stuff instead of 'node-imap'. Also double checked that the INBOX connection is in write mode.
Oh wait, I missed that you're not using the seq
namespace when calling addFlags
. Without it, it's working with UIDs. Use imap.seq.addFlags()
instead.
Awesome, thanks so much @mscdex, it worked perfectly with seq.addFlags
!!!
Curious why it worked so far with imap.addFlags
for at least 3 other mail providers ^^ and I'm sure I was manipulating seqno to fetch, and then to process emails:
const f = imap.seq.fetch(newMessageIDs, {
bodies: '',
struct: true,
});
f.on('message', (message, seqno) => {
message.on('body', onMailBody(seqno));
});
Anyway, happy it's working with Outlook now. Closing the issue...
Hello!
It's very strange, using
imap.addFlags
worked so far with most email providers (Gmail, etc...) BUT didn't work with Outlook (https://outlook.live.com / personal email account):For the record, I followed these steps to create an "App password":
![Screenshot from 2022-12-23 23-07-35](https://user-images.githubusercontent.com/47316824/209409693-94cfaa98-9b6c-4acd-bfc0-bb041c8aff89.png)
And here is how I'm connecting:
And here is what the box object looks like:
I also tried with
setflags
but to no avail.Any idea? Thanks in advance for your help!