#18: implement SMTP Submission (587/465), SASL PLAIN/LOGIN auth and preflight diagnostics

This commit is contained in:
Lucas Rayan committed 2026-08-01 22:49:02 -03:00
1 parent 7249419efc
commit d56f29d084
70 files changed
+5163 -659

No files matched your search

@@ -6,10 +6,15 @@ import (
"github.com/google/uuid"
)
// MailboxAuth is the subset of mailbox data needed to verify a login.
// MailboxAuth is the subset of mailbox data needed to verify a login and,
// once authenticated, to apply the sender policy of PLAN.md section 5.2.
type MailboxAuth struct {
ID uuid.UUID
PasswordHash string
EmailAddress string
DomainName string
// MaxRecipientsPerHour caps a compromised account's blast radius.
MaxRecipientsPerHour int
}
// AuthRepository resolves a login address to its stored credential.
@@ -4,11 +4,11 @@ import "context"
// ImapFolderRecord is the IMAP-relevant subset of a folder row.
type ImapFolderRecord struct {
ID string
Name string
UIDNext uint32
UIDValidity uint32
NumMessages uint32
ID string
Name string
UIDNext uint32
UIDValidity uint32
NumMessages uint32
HighestModSeq uint64
}
@@ -2,6 +2,9 @@ package port
import (
"context"
"time"
"github.com/google/uuid"
"lambdamail/protocols/internal/domain/entity"
)
@@ -10,4 +13,9 @@ type OutboundRepository interface {
Enqueue(ctx context.Context, job *entity.OutboundJob) error
FetchNextReady(ctx context.Context, workerID string, limit int) ([]*entity.OutboundJob, error)
UpdateJob(ctx context.Context, job *entity.OutboundJob) error
// CountRecipientsSince reports how many recipients a mailbox has queued
// since a point in time. It backs the per-mailbox send limit that keeps a
// compromised account from becoming a spam source (PLAN.md section 5.2).
CountRecipientsSince(ctx context.Context, mailboxID uuid.UUID, since time.Time) (int, error)
}