enough_mail_app icon indicating copy to clipboard operation
enough_mail_app copied to clipboard

Offline Message

Open webtech09 opened this issue 3 years ago • 3 comments

I cant view my messages when im offline, all mail mobile application have like this.,

webtech09 avatar Jun 07 '22 11:06 webtech09

Just a short update: there's work ongoing for offline support... But it's tricky 😅

robert-virkus avatar Oct 12 '22 19:10 robert-virkus

Hello, this is great news. I can't wait to experience this already. Thank you @robert-virkus

muhyal avatar Oct 12 '22 20:10 muhyal

@robert-virkus

Can you share how you want to implement this feature? Because currently I am working on a mail App too, but it lacks on offline support. (Using Flutter and your packages – they are awesome).

Firstly: All what I say is probably very wrong. I don´t know very much about IMAP or SMTP. Its more like “In blaue hinein 😉”.

But to the point. Because recently all my good E-Mail-Mobile Apps have some very strange behaviour (Outlook doesn´t load some E-Mails, no sents etc. | Gmail lacks on Multi-Account AND FOLDERS ARE NOT WORKING AT ALL/mostly. It´s so hilarious). So had the idea to create my own.

Now everything works fine as an IMAP client (for the moment I don´t have SMTP/Sending functionality). And for my use, it´s perfect. Good Support for multiple Accounts/Inboxes, Slim Design, shortcuts, etc. But If I am offline, obviously the App doesn’t work anymore. So my Idea was: At root there are two dirs: mailboxes all mailboxes mailinfo File with all the data about the Mailboxes (like name, separator etc.)

grafik

grafik

A File of Mailinfo contains something like this json structure:

{"encodedName":"Trash","name":"Trash","encodedPath":"Trash","path":"Trash","pathSeparator":".","extendedData":{},"flags":"[MailboxFlag.hasNoChildren, MailboxFlag.unMarked, MailboxFlag.trash]","firstUnseenMessageSequenceId":null,"highestModSequence":null,"isReadWrite":false,"messageFlags":[],"messagesExists":0,"messagesRecent":0,"messagesUnseen":0,"permanentMessageFlags":[],"uidNext":null,"uidValidity":null,"id":6}

This method works like a charm for mailboxes tbh. But the problem comes with the mail-messages itself.

grafik grafik

Example content of “1.mail”:

From: "Microsoft Outlook" [email protected] 
To: [email protected]
Subject: Microsoft Outlook-Testnachricht

This is the MimeMessage stored in the file. With MimeMessage.parsefromText() it can be easily transformed back into a MimeMessage. Note: This is a saved preview, so that the user can see their emails without loading all the content. Normally headers, body etc. would be loaded to.

But with this, some Information’s, like the uid or the sequence is lost. Of course you could add a new file or append it to the exsisting, but this is verrrrryyyy non production ready.

  1. So, my question. How do you want to achieve something like offline availability. Because I think this is one of the most important feature of an Imap clients?
  2. Secondly. Has anybody an Idea how other Mail-Programs like Outlook or Gmail are saving their E-Mails?
  3. Also just a short question. As I said am very new to the IMAP Protocol, but why are “messagesExists":0,"messagesRecent":0,"messagesUnseen":0," always 0, even if there are mails in that mailbox

Vito0912 avatar Nov 27 '22 18:11 Vito0912