Mailspring icon indicating copy to clipboard operation
Mailspring copied to clipboard

[WIP] Download email/folder, using `.eml` format - Community#325

Open glenn2223 opened this issue 3 years ago • 4 comments
trafficstars

Work towards Export/Copy/Backup Emails

This pull request is the first (hopefully of many 😁) towards .eml support.

This PR provides:

  • an option in the reply drop-down called "Download Email". Clicking this will prompt the user for the output directory and will save it upon selection
  • right-clicking folder (excluding Drafts, Unread, Starred) gives an option to "Export the folder" (this will not create a directory, it just saves the messages in the path provided)

Need

Approval for the image, or leave it as is (no image) - if you want the image, how do I add it (linking it doesn't work)

Can I have thoughts on sub-folders? Do we just recurse over them and create the subdirectories by default, maybe have an extra option to say "Export just this folder"?

Help

The issue: I started to export almost 1500 emails, then clicked on one, it was only after all 1500 downloaded that the email was rendered.

Possible solution: I need to be able to deprioritise a task, when it's sent to mailsync, or have a new action, something like Action.queueBackgroundTasks. Either way, this would sit these tasks at the sideline while the other (more important) tasks come through.

glenn2223 avatar Aug 23 '22 15:08 glenn2223

This pull request has been mentioned on Mailspring Community. There might be relevant details there:

https://community.getmailspring.com/t/export-copy-backup-emails/325/17

foundry376-bot avatar Aug 23 '22 16:08 foundry376-bot

This pull request has been mentioned on Mailspring Community. There might be relevant details there:

https://community.getmailspring.com/t/export-copy-backup-emails/325/18

foundry376-bot avatar Aug 25 '22 12:08 foundry376-bot

Hey hey - this looks great! I think you're right that mailsync needs a mechanism for background tasks, and we likely need just one background task to represent the "export folder" operation so that it's easy to cancel + attach progress. I'm a bit worried that queueing tons and tons of individual tasks might cause problems.

I like the idea of adding a "priority" value to tasks and then sorting by priority when mailsync retrieves a task to run. Maybe something like that would work?

bengotow avatar Oct 10 '22 14:10 bengotow

and we likely need just one background task to represent the "export folder" operation so that it's easy to cancel + attach progress. I'm a bit worried that queueing tons and tons of individual tasks might cause problems.

YES PLEASE!!!!!!!!!!!!!!!! 😂

And I agree, there wouldn't be an easy way of cancelling these tasks - if the user decided to

I like the idea of adding a "priority" value to tasks and then sorting by priority when mailsync retrieves a task to run. Maybe something like that would work?

That was my other choice and that would definitely work.


PS: sorry if there's any shoddy code. Full discretion, I have almost no experience with React and Electron 😁

glenn2223 avatar Oct 10 '22 14:10 glenn2223