Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offline Message #68

Open
webtech09 opened this issue Jun 7, 2022 · 3 comments
Open

Offline Message #68

webtech09 opened this issue Jun 7, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@webtech09
Copy link

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

@robert-virkus robert-virkus added the enhancement New feature or request label Jun 17, 2022
@robert-virkus
Copy link
Member

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

@muhyal
Copy link

muhyal commented Oct 12, 2022

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

@Vito0912
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants