Open stratbasher opened 1 year ago
I'm an idiot - making it async didn't give time for imap to resolve the attributes. Removing "async" fixed the issue.
I spoke too soon. I put two log lines into parseUnread().
One in:
f.on('message', (msg, seqno) => {
attrs=0;
**console.log(attrs);**
}
And one in:
msg.on('body', async (stream, info) => {
let parsed = await simpleParser(stream);
**console.log('emitting mail');**
}
When running my code against an mailbox with existing mail, I'm getting the "emitting mail" message without any attrs. I think this has to be some sort of synchronicity issue where the 'attributes' event gets fired after 'body' does.
This is further reinforced by the fact that if I put some breakpoints in the mail-listener5 index.js file to manually slow things down, I will get the attributes variable.
@MorphedAU did you ever figure this out?
Hello,
My code worked a few days ago when I was running an older version of mailListener. I decided to run npm update yesterday. I'm not sure what version it was but it was probably about 6 months old. I tried to downgrade but I didn't see any older releases.
Using Node v19.7.0
The "attributes" variable is null when trying to access the uid variable so I can move the email to another folder.
Any ideas on what I can troubleshoot?