Email ingestion for support tickets (IMAP/POP3 via Supabase Edge Function)
Scheduled Supabase Edge Function (Deno) that polls a configured IMAP mailbox per project on a cron interval, parses MIME, and either creates a new support_ticket or appends a support_message to an existing thread. Threading via In-Reply-To / References / Message-ID headers; idempotency via support_messages.external_message_id unique index.
Per-project mailbox config (host, port, user, app password, ssl) stored encrypted (pgsodium) in a support_mailboxes table; only owners can read. Bounces and auto-replies filtered out. Outbound replies go via the same SMTP creds (or via SendGrid if Stripe-tier allows).
Out of scope: full SMTP fanout to many recipients, OAuth (Gmail/Microsoft) - paste-an-app-password flow only in v1.
Comments (0)
No comments yet.
Sign in to leave a comment.