Skip to main content

E-Mail-Tabellen

Das Datenbankschema wurde von Weiss Global entworfen. Hier die Übersicht der E-Mail-relevanten Tabellen:

email_accounts

Konfiguration der angebundenen E-Mail-Konten.
SpalteTypBeschreibung
iduuidPrimary Key
email_addresstextE-Mail-Adresse
display_nametextAnzeigename
imap_hosttextIMAP-Server
imap_portintegerIMAP-Port (993)
smtp_hosttextSMTP-Server
smtp_portintegerSMTP-Port (465)
encrypted_passwordtextPasswort (Platzhalter, echtes PW in .env)
is_activebooleanAktiv/Inaktiv
Account-ID für team@events-52grad.de: 0bd9c6b2-9ef2-4c9e-8066-a922e7c02a7c

emails

Alle ein- und ausgehenden E-Mails.
SpalteTypBeschreibung
iduuidPrimary Key
account_iduuidFK → email_accounts
message_idtextRFC Message-ID
in_reply_totextParent Message-ID (Threading)
referencesarrayGesamte Reference-Kette
thread_iduuidFK → email_threads
foldertextIMAP-Ordner (INBOX, Gesendete Objekte)
directiontextinbound oder outbound
uidbigintIMAP UID
from_addressjsonb{name, address}
to_addressesjsonb[{name, address}, ...]
cc_addressesjsonb[{name, address}, ...]
bcc_addressesjsonb[{name, address}, ...]
subjecttextBetreff
text_bodytextPlain-Text-Body
html_bodytextHTML-Body
datetimestamptzSende-/Empfangsdatum
has_attachmentsbooleanHat Anhänge?
flagsarrayIMAP-Flags (\Seen, \Flagged etc.)
headers_rawjsonbAlle Header als Key-Value
size_bytesintegerGröße in Bytes
is_readbooleanGelesen?
is_starredbooleanMarkiert?
is_archivedbooleanArchiviert (soft-delete)?
customer_iduuidFK → customers
company_iduuidFK → companies
synced_attimestamptzZeitpunkt der Synchronisation

email_threads

Gruppierung zusammengehöriger E-Mails.
SpalteTypBeschreibung
iduuidPrimary Key
account_iduuidFK → email_accounts
thread_keytextErste Message-ID im Thread
subjecttextBereinigter Betreff (ohne Re:/AW:)
last_message_attimestamptzLetzte Nachricht im Thread
message_countintegerAnzahl Nachrichten
participant_addressesarrayAlle beteiligten E-Mail-Adressen
is_unreadbooleanUngelesene Nachrichten?

email_attachments

Datei-Anhänge.
SpalteTypBeschreibung
iduuidPrimary Key
email_iduuidFK → emails
filenametextDateiname
content_typetextMIME-Type
size_bytesintegerGröße in Bytes
storage_pathtextPfad in Supabase Storage
content_idtextContent-ID für Inline-Bilder
is_inlinebooleanInline-Anhang?
checksumtextPrüfsumme

email_sync_state

Synchronisationsstatus pro Ordner.
SpalteTypBeschreibung
iduuidPrimary Key
account_iduuidFK → email_accounts
folder_nametextIMAP-Ordnername
uid_validitybigintIMAP UID Validity
last_uidbigintZuletzt synchronisierte UID
sync_statustextidle, syncing, error
error_messagetextLetzte Fehlermeldung
last_synced_attimestamptzLetzter erfolgreicher Sync

Storage

Anhänge werden in Supabase Storage gespeichert:
  • Bucket: email-attachments (privat)
  • Pfadstruktur: {account_id}/{email_id}/{filename}
  • Max. Dateigröße: 10 MB