Return to

[Devember 2021] Email downloader

Hi there, For my devember project, I want to (re)build an IMAP email downloader

I will develop it in golang

  • Download email
  • Download attachment

Create a JSON file with info and body inside


forgot the github link sorry GitHub - rogafe/go-email: I was inspired by polo2ro imapbox to create a way to download my email to a folder and I wanted to build it in Golang


I can see this being really useful, but IMO it would have to at least support:

  • downloading all folders, not just inbox like the one you took inspiration from
  • multiple account support
  • normie mode - here is my login details, go backup everything! Go!

Best of luck, I’m really looking forward to seeing where this goes!

Right on! Hope your project goes well. I do have to second vivante’s comment. Good luck!

Thanks for the encouraging comment’s, everyone.

@vivante I added one of your idea go-email now as the capability of downloading all folders.

I will try to do the rest of your idea, tomorrow.

1 Like

As of 2021-10-26T22:00:00Z

Go-email can:

  • Download all mails from one directory
  • Download all mails from all directory
  • Write the email in JSON, EML (plain text) and HTML
  • Write Attachment

Future goals:

  1. Add multi account support
  2. Add normie modes (with interface maybe like the web interface of rclone to be multiplatform)
  3. Add support for Elasticsearch
  4. Add support for other database
1 Like

Another goal if you’ve got the motivation: support google’s oauth so you don’t need to use an app password for gmail? (I can’t use isync with my company gmail because app passwords are disabled :frowning: )

1 Like

That a great idea, I will see if it is possible with the library I use natively or if I have to do it myself.

I think it is possible great

Oh, you’re awesome!


It works, but I have to integrate it inside the go-email.

For now, it’s an outside project and I don’t have a workspace, so my testing is with my Google account with two factor activated.

I will try to commit it this week.

Okay, I could take a swing at it later if you’d like. Don’t want to step on any toes though.

If you think you could add something to the project I am not against it.


Update as of 2021-10-28T22:00:00Z


I finished the OAuth with Gmail it could work with any other provider, I think.

See the last release here

Don’t forget to download the secret.json from Google console view my wiki.

1 Like

Hello all,

Update as of 2021-11-13T23:00:00Z

Sorry for the late update, but life appended.

Quick update

Feature parity with imapbox :

  • JSON output
  • EML output
  • HTML output

To-do :

  • Using global config to use as a demon (XDG_CONFIG_HOME/go-email, /etc/go-email)
  • EML to EML.gz to gain space
  • TXT output
  • PDF output
  • Usage of a global config (useful for a server)
1 Like

Update as of the 2021-12-03T23:00:00Z

Hello all,

Twenty days since my last post, time fly really fast and work took over for a bit.

Anyhow, I tried to download my email from my o365 account and outlook use cid for image, which broke the HTML output.

I just push a fix to the main branch.

I have to ask out, would you handle the attachment and image, should I create a subfolder inside the mail folder to store all the artifact? Furthermore, I think it would be the best way to do it, but I welcome any new idea.

Rogafe out