feat(PROJ-8): Automatischer IMAP-Sync (Cron-Scheduler)

Backend:
- internal/imap/store.go: 7 neue Felder (sync_interval_min, last_sync_at,
  last_sync_count, last_uid, sync_running, sync_status, sync_error_msg)
  DB-Migration via ALTER TABLE ADD COLUMN IF NOT EXISTS
  Neue Methoden: ListAll, UpdateSyncInterval, SetSyncRunning, UpdateSyncResult
- internal/imap/scheduler.go: Scheduler mit time.Ticker (1 min),
  inkrementeller Sync via UID SEARCH UID <lastUID+1>:*,
  exponential backoff (3 Versuche: 1s / 60s / 300s),
  sync_running-Flag verhindert parallele Syncs
- internal/api/server.go: POST /api/imap/{id}/sync (manueller Trigger),
  PATCH /api/imap/{id} (sync_interval_min setzen, 0 oder 5-1440 min)
- cmd/archivmail/main.go: Scheduler gestartet + via SetImap verdrahtet

Frontend:
- src/lib/api.ts: 6 neue ImapAccount-Felder, triggerImapSync, updateImapInterval
- src/app/imap/page.tsx: Intervall-Dropdown, "Sync jetzt"-Button,
  Letzter-Sync-Anzeige mit Status-Badge, Polling auch bei sync_running

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
sysops
2026-03-17 02:17:44 +01:00
parent 9cc540a880
commit 988c37d85d
9 changed files with 762 additions and 52 deletions
+31
View File
@@ -0,0 +1,31 @@
export type FeatureStatus = "Planned" | "In Progress" | "In Review" | "Deployed";
export interface Feature {
id: string;
name: string;
status: FeatureStatus;
frontend: boolean;
backend: boolean;
lastUpdated: string; // YYYY-MM-DD
}
export const features: Feature[] = [
{ id: "PROJ-1", name: "Authentifizierung & Rollen", status: "In Review", frontend: true, backend: true, lastUpdated: "2026-03-15" },
{ id: "PROJ-2", name: "Import: EML/MBOX Upload", status: "In Progress", frontend: true, backend: true, lastUpdated: "2026-03-12" },
{ id: "PROJ-3", name: "Import: IMAP-Verbindung", status: "In Progress", frontend: true, backend: true, lastUpdated: "2026-03-12" },
{ id: "PROJ-4", name: "Import: SMTP-Eingang via BCC", status: "In Progress", frontend: false, backend: true, lastUpdated: "2026-03-12" },
{ id: "PROJ-5", name: "Speicherung & Volltext-Indexierung", status: "In Review", frontend: false, backend: true, lastUpdated: "2026-03-14" },
{ id: "PROJ-6", name: "Volltext-Suche & Filterung", status: "In Progress", frontend: true, backend: true, lastUpdated: "2026-03-12" },
{ id: "PROJ-7", name: "E-Mail-Ansicht (Lesen & Anhänge)", status: "In Progress", frontend: true, backend: true, lastUpdated: "2026-03-12" },
{ id: "PROJ-8", name: "Automatischer IMAP-Sync (Cron-Job)", status: "In Progress", frontend: false, backend: true, lastUpdated: "2026-03-12" },
{ id: "PROJ-9", name: "Ordner- & Label-Verwaltung", status: "In Progress", frontend: false, backend: false, lastUpdated: "2026-03-12" },
{ id: "PROJ-10", name: "Admin-Bereich: Nutzer- & Postfachverw.", status: "In Progress", frontend: true, backend: true, lastUpdated: "2026-03-12" },
{ id: "PROJ-11", name: "Audit-Log & Compliance-Berichte", status: "In Progress", frontend: true, backend: true, lastUpdated: "2026-03-12" },
{ id: "PROJ-12", name: "E-Mail-Export (EML/PDF/ZIP)", status: "In Review", frontend: true, backend: true, lastUpdated: "2026-03-13" },
{ id: "PROJ-13", name: "REST API für externe CRM-Anbindung", status: "In Progress", frontend: false, backend: true, lastUpdated: "2026-03-13" },
{ id: "PROJ-14", name: "Import: POP3-Verbindung", status: "In Progress", frontend: false, backend: false, lastUpdated: "2026-03-13" },
{ id: "PROJ-15", name: "CLI Import & Export", status: "In Review", frontend: false, backend: true, lastUpdated: "2026-03-13" },
{ id: "PROJ-16", name: "LDAP / Active Directory Anbindung", status: "In Progress", frontend: false, backend: false, lastUpdated: "2026-03-13" },
{ id: "PROJ-17", name: "Admin Dashboard Systemauslastung", status: "In Review", frontend: true, backend: true, lastUpdated: "2026-03-14" },
{ id: "PROJ-18", name: "E-Mail Integritätsprüfung", status: "In Review", frontend: true, backend: true, lastUpdated: "2026-03-14" },
];