mscdex / node-imap

An IMAP client module for node.js.
MIT License
2.16k stars 380 forks source link

Search Query with a message-id in HEADER REFERENCES as criteria fetching undefined. #831

Open varunexpsde opened 3 years ago

varunexpsde commented 3 years ago

Issue

I was trying to search for the messages with a message-id in the HEADER REFERENCES, and I receive zero results/undefined every time. However, my actual intention is to write a search query criteria as below to fetch all the messages in a thread.

[['OR', ['HEADER', 'MESSAGE-ID', msgId], ['HEADER', 'REFERENCES', msgId]]]

So, I tried checking:

['ALL', ['HEADER', 'REFERENCES', msgId]]

The simple search of messages with references having msgId is failing.

Here's the Screenshot with debug options for just fetching messages by references.

node-imap issue
MadhabaPatra commented 1 year ago

Hey @VarunRaj7 , Have you got any solution ? I am using Gmail,i am able to find mails by in-reply-to.

varunexpsde commented 1 year ago

Hi @MadhabaPatra, Yes, you could use the in-reply-to field that establishes the parent-child relationship between two emails and will let you realize the tree of the emails in a conversation!!

MadhabaPatra commented 1 year ago

@VarunRaj7 , So In my case i was searching for the message by message id and the email engine is Gmail. So instead of searching in the "INBOX" folder , i tried to search in the box with "[GMAIL]/ALL MAIL" and it worked.