Inbox
Mailboxes, inbound messages, and attachments.
Source: packages/db/src/schema/inbox.ts
Enums
| Enum | Values |
|---|---|
mailbox_status | active, disabled |
inbound_email_status | received, processing, delivered, spam, rejected, failed |
mailbox
| Column | Type | Notes |
|---|---|---|
id | text | PK, prefix mbx_ |
email | varchar(255) | NOT NULL, UNIQUE |
password | text | NOT NULL |
quota | text | default 5 GB |
status | mailbox_status | default active |
display_name | varchar(255) | |
organization_id | text | FK → organization.id, CASCADE |
domain_id | text | FK → domain.id, CASCADE |
created_at | timestamp | |
updated_at | timestamp |
inbound_email
| Column | Type | Notes |
|---|---|---|
id | text | PK, prefix inb_ |
mailbox_id | text | FK → mailbox.id, CASCADE |
organization_id | text | FK → organization.id, CASCADE |
from_email | varchar(255) | NOT NULL |
from_name | varchar(255) | |
to_emails | text[] | NOT NULL |
cc_emails | jsonb | |
bcc_emails | jsonb | |
reply_to | varchar(255) | |
subject | text | |
text_body | text | |
html_body | text | |
snippet | varchar(300) | |
raw_message | text | |
size | bigint | default 0 |
status | inbound_email_status | default received |
is_read | boolean | default false |
is_starred | boolean | default false |
is_spam | boolean | default false |
spam_score | real | |
message_id | text | RFC 822 Message-ID |
thread_id | text | legacy threading |
in_reply_to | text | |
references | jsonb | |
headers | jsonb | |
date | timestamp | sender Date header |
created_at | timestamp |
inbound_attachment
| Column | Type | Notes |
|---|---|---|
id | text | PK, prefix inbatt_ |
inbound_email_id | text | FK → inbound_email.id, CASCADE |
filename | text | NOT NULL |
content_type | varchar(255) | NOT NULL |
size | integer | NOT NULL |
storage_path | text | NOT NULL, MinIO path |
content_disposition | varchar(50) | default attachment |
content_id | text | inline cid: reference |
checksum | varchar(128) | SHA-256 |
created_at | timestamp |
Was this page helpful?