Get as far as storing an incoming mail in crockery.db

This commit is contained in:
2018-03-08 01:39:24 +00:00
parent be7ca459a5
commit b4537d1283
6 changed files with 123 additions and 3 deletions

22
internal/store/message.go Normal file
View File

@@ -0,0 +1,22 @@
package store
import (
"net/mail"
)
type MessageInterface interface {
CreateMessage(Message) error
}
type Message struct {
ID string
Username string `storm:"index"` // FK accounts.username
Mailbox string `storm:"index"` // The mailbox, e.g. `INBOX` or `Foo/Bar`
Header mail.Header
Body []byte
}
func (c *concrete) CreateMessage(message Message) error {
return c.storm.Save(&message)
}