Extremely WIP, but now messages appear in the evolution list pane

This commit is contained in:
2018-03-09 03:20:22 +00:00
parent b661b4a978
commit 3c52b23723
10 changed files with 211 additions and 75 deletions

View File

@@ -9,6 +9,7 @@ import (
"gopkg.in/urfave/cli.v1"
"ur.gs/crockery/internal/imap"
"ur.gs/crockery/internal/store"
)
@@ -69,13 +70,24 @@ func crockeryInit(c *cli.Context) error {
return err
}
postmaster := &store.Account{
Username: "postmaster@" + domain,
Admin: true,
PasswordHash: hash,
username := "postmaster@" + domain
mailbox := store.Mailbox{
Account: username,
Name: imap.InboxName,
}
if err := datastore.CreateAccount(postmaster); err != nil {
if err := datastore.CreateMailbox(&mailbox); err != nil {
return fmt.Errorf("Failed to create admin mailbox %s: %v", mailbox.Name, err)
}
postmaster := store.Account{
Username: username,
Admin: true,
PasswordHash: hash,
DefaultMailbox: mailbox.ID, // Automatically filled in by the store
}
if err := datastore.CreateAccount(&postmaster); err != nil {
return fmt.Errorf("Failed to create admin account %s: %v", postmaster.Username, err)
}