2018-03-05 12:19:04 +00:00
|
|
|
# Crockery design
|
|
|
|
|
2018-03-05 22:29:31 +00:00
|
|
|
## Overview
|
|
|
|
|
2018-03-05 12:19:04 +00:00
|
|
|
We need:
|
|
|
|
|
|
|
|
* SMTP server
|
|
|
|
* Receive emails -> middlewares -> storage
|
|
|
|
* https://github.com/emersion/go-smtp ?
|
|
|
|
* IMAP server
|
|
|
|
* Receive logins
|
|
|
|
* HTTP server
|
|
|
|
* Serve autodiscovery bumpf
|
|
|
|
* ActiveSync protocol
|
|
|
|
* Storage
|
|
|
|
* Accounts
|
|
|
|
* Passwords!
|
|
|
|
* Emails
|
|
|
|
* TLS keys + certificates
|
|
|
|
* Search emails - some sort of inverted index necessary
|
|
|
|
* https://github.com/blevesearch/bleve ?
|
|
|
|
* Embedded database best. Ideally we have a single file to work with
|
2018-03-05 22:29:31 +00:00
|
|
|
* https://github.com/coreos/bbolt
|
|
|
|
* https://github.com/asdine/storm
|
|
|
|
|
|
|
|
## Database structure
|
|
|
|
|
2018-03-06 00:32:49 +00:00
|
|
|
I'm not sure what storm does under the hood. It seems clever. We have the
|
|
|
|
following, though:
|
|
|
|
|
|
|
|
* K-V store
|
|
|
|
* `config/domain`
|
|
|
|
* `domains/<domain>/config/cert`
|
|
|
|
* `domains/<domain>/config/key`
|
|
|
|
* ORM
|
|
|
|
* `Account`
|
|
|
|
* `Username`
|
|
|
|
* `Admin`
|
|
|
|
* `PasswordHash`
|