GMail IMAP - How to get conversations (threads) list? - gmail

I am trying create similar view like in GMail. I know that GMail IMAP
have extension X-GM-THRID which I can use in FETCH command, but this
return me this same numbers of items and I must group them manually by
thread ID. Exists any faster way to group this? I am mean, can google
imap server return me list of messages grouped by thread id (like in gmail web interface)? To be more specific:
If I have this list (THREAD ID | TEXT)
12345 "hello"
12345 "hi"
12345 "what's up?"
67890 "are you there?"
67890 "no, I'm not"
I want get from server only:
12345 "hello"
67890 "are you there?"
Can I do that? Finally, I would have to group this by my self, but this solution is inefficient and slow (I have many messages to group)
Regards and sorry for my English.

The 'In-Reply-To' header of the child should have the value of the Message-Id header of the parent.
There is one another field in header 'References' which contains message ids of all its parent.
you can user either of them as per your requirement.

Years old, but:
The unsatisfying answer is: you can't --- IMAP only knows about messages, not threads, so you can only get thread information by looking at all the messages and aggregating.that.
What you can do is to fetch just the UID and X-GM-THRID fields, which is fast (about 40 bytes or so per message). Then you find the first message for each thread, then use UID FETCH to pull just those. By not fetching the entire message envelope until you know which messages to fetch you save a lot of bandwidth.

Related

Fetch discord’s message containing specific words

How do i find messageID of the latest message from a specific user containing certain word
i.e
if 2 people sends same message but if i provide 1st person’s userID then it will bypass 2nd users message and get the messageID of 1st users'
I dont know if this is possible haven’t done anything yet!

How can I do it in my bot?

I'm new here and I have a question
I want to create telegram bot
and I want to send to every member in this bot a message that only him can see it
what I mean if I have 100 person on my bot
I want to send 100 message to 100 person but every person will get 1 message
and all the 100 people will get different message to another one
so how can I do it ?
please enlighten me ...
this is simple GET method:
https://api.telegram.org/bot<token>/sendMessage?chat_id=<chat_id>&text=<text>
chat_id is unique for any user, you can send one, two or more different message to any user - just use different chat_id and text.
or if you want to sent one message to all user - just call this get method with one text and diff chat_id

gmail-api to check how many mails are unread and user has not replied to

I am developing an android app based on gmail-api in which I need to show how many mails are unread (based on a particular sender/subject) , and also need to show how many mails the user has not replied to (based on a particular sender/subject) . If anybody has done this pls let me know if this is feasible.
You need to use Users.messages: list method since it only return messages that match the specified query. It supports the same query format as the Gmail search box. For example, from:someuser#example.com rfc822msgid: is:unread.
Based also from this related SO ticket, the q parameter (query) can be all kinds of stuff and it is the same as the gmail search bar on the top of the web interface. You can use this search method to find unread messages, for example like
List<Message> unreadMessageIDs = ListMessages(service, "me", "is:unread");.
Hope this helps! :)

When does Message ID get populated in Lotus Notes?

I'm trying to use the Message ID property on a mailbox item to determine whether it's a journaled or non-journaled item.
When I say non-journaled I mean, calendar events, contacts, drafts.
Is this the right thing to do? Is the Message ID assigned when the item is sent?
The Messsage ID is assigned to the $MessageID item by the router when the message is submitted to be sent. A calendar event will not contain a $MessageId, but a calendar invitation or calendar notice will, because they are processed by the mail system.
However, the presence of a $MessageId item does not necessarily mean the message was mailed to or by the specific mailbox that you are looking at, because a message can easily be copied and pasted between mailboxes.
And it's also true that the absence of a $MessageID does not necessarily mean it wasn't mailed, either. I am almost certain that I've seen cases where messages in a user's Sent folder, and which were actually sent, didn't have the $MessageID. I can't recall the circumstances for that, though. (It's pretty easy for a knowledgeable user to remove the $MessageID item from a message by running a simple agent, so that's an obvious reason why you can't count on the $MessageId being there, but that's not the case I'm thinking of.)(

Parse text of a Received SmsTool3 & eventhandler

I am searching this forum(and others) and I can't find how exactly the eventhandler of the SMSTools works. How does it know when it's receiving or sending in order to take an action? Think is better to explain what I want.
I want to use the eventhandler in this scenario:
I am using a IDS which is sending information by SMS via smstools. Everything is ok by now, I am receiving what I need.
The problem is that when the smstools is receiving an SMS, I want to check if it's from the correct phone number (mine for example or a list of numbers would be better).
If it's the correct number, I want to see the text (the text will pe simple, like: yes or no) and take an action depending on it.
I will really appreciate any answer.

Resources