Let's do it! Here's what we have to do:
- Fetch a list of all mailboxes
- Get config from config.yaml
- Download all messages in a mailbox
- Save the messages in a DB
- Create a message fetching API
- Save more info from the messages to the DB (standard headers, if there's an attachment and such)
- Save the contact info from the message to the DB
- Serve only the parsed headers of messages on the main API
- references field is not parsed with stripped <
- Serve all of the contents when a message is requested
- Save email threads info somewhere
- Serve threads on the API
- Take database conn info from an env file as well
- Support updates of mailboxes
- Catch errors and recover from them where needed
- Support update of all the mailboxes for an account (also of a selection)
- Watch for message changes from the server (polling and watching)
- Deal with attachments
- Save the info on whether there are attachments (and which) to the DB
- Serve the attachments on a separate endpoint
- Parallel fetches (arbitrary parallel fetches)
- Support multiple accounts
- Integrate with GPG for automatic message decryption
- Add a search endpoint
- Choose a search engine (just postgres or maybe elastic?)
- Make sure that the search 'makes sense'
- Add an email address hints endpoint
- Make an email-reading interface
- Post async updates to websockets as we update/fetch
- Add tests