Files
crockery/DESIGN.md

49 lines
1.2 KiB
Markdown
Raw Normal View History

2018-03-05 12:19:04 +00:00
# Crockery design
## 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
* Give it a home directory. Stores Maildirs + settings DB + TLS
2018-03-05 12:19:04 +00:00
* Accounts
* Passwords!
* Emails
* TLS keys + certificates
* Emails go into Maildirs
* Search emails - some sort of inverted index necessary. One per maildir?
2018-03-05 12:19:04 +00:00
* https://github.com/blevesearch/bleve ?
* Settings DB should be a simple K-V store for accounts, passwords, etc. BoltDB?
* https://github.com/coreos/bbolt
* https://github.com/asdine/storm
## Database structure
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`
2018-03-06 01:06:47 +00:00
* `Wildcard`
* `PasswordHash`
I don't seem to be able to get accounts for a list of usernames very easily, or
indexed-ly.
Messages are stored in a traditional Maildir structure structure following a
`<home>/mailboxes/<domain>/<username>` hierarchy.