Mail deliverability dashboard: findings with fixes, DMARC report ingestion, alerts on regressions

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
VeillaxandClaude Sonnet 5.5 committed 2026-10-27 17:01:45 -06:00
1 parent 39659f0144
commit 6d912ddd22
11 files changed
+890 -18

No files matched your search

+2 -1
View File
@@ -53,7 +53,7 @@ CREATE TABLE IF NOT EXISTS alert_events (
key TEXT, status TEXT, name TEXT, message TEXT
);
CREATE INDEX IF NOT EXISTS alert_events_org ON alert_events (org_id, id);
`
` + dmarcSchema
type DB struct {
sql *sql.DB
@@ -547,6 +547,7 @@ func (d *DB) queryAudit(org string, limit int, before int64) []AuditEntry {
// purge deletes logs older than the retention periods.
func (d *DB) purge(accessDays, auditDays int) {
d.purgeDMARC(time.Now().AddDate(0, 0, -dmarcKeepDays))
if accessDays > 0 {
d.sql.Exec(`DELETE FROM access_log WHERE ts < ?`, ms(time.Now().AddDate(0, 0, -accessDays)))
}