diff --git a/backend/imap-idle/index.mjs b/backend/imap-idle/index.mjs index bc22c58..42e5281 100644 --- a/backend/imap-idle/index.mjs +++ b/backend/imap-idle/index.mjs @@ -44,11 +44,19 @@ const RECONNECT_LOOP_DELAY_MS = 60 * 1000; const pool = new pg.Pool({ connectionString: process.env.DATABASE_URL }); async function loadActiveConnections() { + // DB-table heißt "mail_connections" + snake_case columns (Prisma @map). + // Aliase auf camelCase damit der restliche Daemon-Code unverändert bleibt. const { rows } = await pool.query( - `SELECT id, "userId", email, "imapHost", "imapPort", - "passwordEncrypted", "rejectUnauthorized", "useStarttls" - FROM rebreak."MailConnection" - WHERE "isActive" = true`, + `SELECT id, + user_id AS "userId", + email, + imap_host AS "imapHost", + imap_port AS "imapPort", + password_encrypted AS "passwordEncrypted", + reject_unauthorized AS "rejectUnauthorized", + use_starttls AS "useStarttls" + FROM rebreak.mail_connections + WHERE is_active = true`, ); return rows; }