26 lines
895 B
Go
26 lines
895 B
Go
// Package imapserver implements a minimal read-mostly IMAP4rev1 server backed by
|
|||
|
|
// internal/mailstore, so a mail client (Thunderbird etc.) can retrieve mail this
|
||
|
|
// server received into a local mailbox. Only a single fixed "INBOX" folder is
|
||
|
|
// supported — no folder hierarchy yet (aliases/multiple folders are a later
|
||
|
|
// milestone). Login only accepts an app password (esrv_mailbox_app_passwords), never
|
||
|
|
// a mailbox's own portal password, since IMAP AUTH has no interactive MFA step.
|
||
|
|
package imapserver
|
||
|
|
|
||
|
|
import (
|
||
|
|
"mailgoserver/internal/db"
|
||
|
|
"mailgoserver/internal/mailstore"
|
||
|
|
"mailgoserver/internal/toolbox"
|
||
|
|
)
|
||
|
|
|
||
|
|
// Backend holds the shared dependencies every connection's Session uses, mirroring
|
||
|
|
// smtpserver.Backend.
|
||
|
|
type Backend struct {
|
||
|
|
DB *db.DB
|
||
|
|
Mailstore *mailstore.Store
|
||
|
|
Logger *toolbox.Logger
|
||
|
|
}
|
||
|
|
|
||
|
|
func (b *Backend) NewSession() *Session {
|
||
|
|
return &Session{backend: b}
|
||
|
|
}
|