Imap search command to get the most recent message? - imap

Is there a command to do this? I can get messages since a certain date, or RECENT or UNSEEN, but I can't find any way to just get the newest message and only the newest message.

When you connect, the server gives you an EXISTS, telling you how many messages you have. Take that number (say, 62), and fetch that message: tag FETCH 62 (whatever). That's the most recent message that's been added to the mailbox.

Related

Twilio Programmable chat: Get Deleted messages

I want to give user the ability to delete messages.
In the code I am deleting a message using : message.remove(); and the message gets delete all fine.
Now I want to show users in the chat that a message was deleted at that particular place (like in whatsapp). But channel.getMessages() gives only non-deleted messages.
Is there a way to get deleted messages from twilio?
If not possible, I am thinking to update the message when user wants to delete (deleting only the message body). Please suggest if this is the best solution.
Twilio developer evangelist here.
Deleting a message will remove the message. If you want to keep that message history, your best bet would be to add an attribute to the message to indicate that it was deleted.
You can update the attributes of a message with the message.updateAttributes() method and then listen for updates on messages with the messageUpdated event and remove the message from your UI if the attributes indicate it was removed.

Fetching MUC Message History using MucSub in IOS

Every time when I’m signing into the app or reinstalling app I didn’t receive group message history. I have searched a lot for message archiving in MUC for iOS. Ejabberd doesn’t provide me old messages of the group although I configured setting into the YML file as mentioned in the attached image. I have kept history size of 10. It means at least 10 messages must be fetched every time when I login into the app or reinstall the app but I could not receive 10 messages every-time after reinstalling the app. I’m using Robbiehanson/XMPPFramework for iOS to implement XMPP based chat. I also performed MucSub based MUC to send/receive messages.
The scenario which I have performed:
I’m part of one MUC group. The member of the associated group sent 15 Messages into the group. I have received all those messages when I’m online. Now I am logged out from the group. Deleted the app from the device and reinstalled it into the device with the same login credentials. At this time I could not see the 15 messages which I received earlier. Here I would like to get all 15 Messages even after reinstalling the app into the iOS device.
I have searched on various Stack overflow questions but none of them are helpful to me. Your help will be appreciated.
Maybe you can try joining the room by specifying the history element with the maxstanzas specified.
We have similar case like we need last 3 months history while joining the room, So we mentioned that in history tag, Like below code sample
let historyElement = DDXMLElement(name: "history")
historyElement.addAttribute(withName: "since", stringValue: ((lastDate as NSDate).addingTimeInterval(1).xmppDateTimeString())!)
room.join(usingNickname: userJidString, history: historyElement)

Get latest messages from last known mail Id - Mailcore

Is it possible to get messages based on the last known Email UID. I am able to fetch emails using "fetchMessagesByNumberOperation" method. But somehow i need to implement a way to fetch newest emails from the last known email id.
Let say i have fetched x latest emails. And after 5 minutes i
got three more emails. Now i want to fetch the latest emails from the
last saved UID.
Is it possible to do?
Is it possible to do?
Yes it is.
There is a method named fetchMessagesByUIDOperation for this.
Here is my code in Kotlin, you can achieve same with swift
imapSession().fetchMessagesByUIDOperation(folder, flags,
IndexSet.indexSetWithRange(Range(lastMessageUID, Range.RangeMax)))

Error Downloading SMS logs in Twilio logs page

getting this error "Could not finish exporting all records." while trying to export all SMS sent from my account on a particular date using programming logs interface in twilio portal.
number of records is roughly ~15,000 and error shows up at line 10,001.
Are there any other recommend ways to download the logs ?
Thanks.

Gmail Mailbox updates

I have created a app in Ruby on Rails in that I want to get the all updates of the gmail mailbox, I tried with push notification provided by gmail in this link https://developers.google.com/gmail/api/guides/push but in this we get only those message related to that topic, but if i want notification on my server for all the messages then what approach should i adopt,
Please let me know if any one have any idea about it.
The topic is a separate issue from what labelIds to get changes for. The reference for watch() says that if you don't specify any labelIds in the watch, then you will get all the changes to the mailbox.

Resources