Skip to content
Pre-release. HostCraft is in testing and not yet for sale. These docs describe the current build and may change. Join the waitlist to hear when it launches.

Mail API

Source: daemon/proto/hostcraft/v1/mail.proto

MailService manages mailboxes, forwarders, autoresponders, Sieve filters, per-domain mail configuration, DKIM, the Postfix queue and Rspamd training. REST: /api/v1/mail.

Method REST route Permission Streaming
ListMailboxes GET /api/v1/mail/mailboxes MailMailboxRead unary
CreateMailbox POST /api/v1/mail/mailboxes MailMailboxCreate unary
GetMailbox GET /api/v1/mail/mailboxes/{id} MailMailboxRead unary
UpdateMailbox PATCH /api/v1/mail/mailboxes/{id} MailMailboxUpdate unary
DeleteMailbox DELETE /api/v1/mail/mailboxes/{id} MailMailboxDelete unary
SetMailboxPassword POST /api/v1/mail/mailboxes/{id}/password MailMailboxUpdate unary
GetMailboxUsage GET /api/v1/mail/mailboxes/{id}/usage MailMailboxRead unary
CreateWebmailSession POST /api/v1/mail/mailboxes/{id}/webmail-session MailWebmailAccess unary
ListMailboxLogins GET /api/v1/mail/mailboxes/{id}/logins MailMailboxRead unary
CreateMailboxLogin POST /api/v1/mail/mailboxes/{id}/logins MailMailboxUpdate unary
ListForwarders GET /api/v1/mail/forwarders MailForwarderRead unary
CreateForwarder POST /api/v1/mail/forwarders MailForwarderCreate unary
GetForwarder GET /api/v1/mail/forwarders/{id} MailForwarderRead unary
UpdateForwarder PATCH /api/v1/mail/forwarders/{id} MailForwarderUpdate unary
DeleteForwarder DELETE /api/v1/mail/forwarders/{id} MailForwarderDelete unary
ListMailingLists GET /api/v1/mail/lists MailListRead unary
CreateMailingList POST /api/v1/mail/lists MailListWrite unary
GetMailingList GET /api/v1/mail/lists/{id} MailListRead unary
UpdateMailingList PATCH /api/v1/mail/lists/{id} MailListWrite unary
DeleteMailingList DELETE /api/v1/mail/lists/{id} MailListWrite unary
GetAutoresponder GET /api/v1/mail/autoresponders/{mailbox_id} MailMailboxRead unary
SetAutoresponder PUT /api/v1/mail/autoresponders/{mailbox_id} MailAutoresponderSet unary
DeleteAutoresponder DELETE /api/v1/mail/autoresponders/{mailbox_id} MailAutoresponderSet unary
ListFilters GET /api/v1/mail/filters MailFilterRead unary
CreateFilter POST /api/v1/mail/filters MailFilterCreate unary
UpdateFilter PATCH /api/v1/mail/filters/{id} MailFilterUpdate unary
DeleteFilter DELETE /api/v1/mail/filters/{id} MailFilterDelete unary
ReorderFilters POST /api/v1/mail/filters/reorder MailFilterUpdate unary
GetMailDomainConfig GET /api/v1/mail/domains/{domain_id}/config MailDomainConfig unary
UpdateMailDomainConfig PATCH /api/v1/mail/domains/{domain_id}/config MailDomainConfig unary
EnableMailDomain POST /api/v1/mail/domains/{domain_id}/enable MailDomainEnable unary
SetCatchAll POST /api/v1/mail/domains/{domain_id}/catchall MailDomainConfig unary
RemoveCatchAll DELETE /api/v1/mail/domains/{domain_id}/catchall MailDomainConfig unary
GetDKIM GET /api/v1/mail/domains/{domain_id}/dkim MailDKIMRead unary
BeginDKIMRotation POST /api/v1/mail/domains/{domain_id}/dkim/rotate MailDKIMRotate unary
CompleteDKIMRotation POST /api/v1/mail/domains/{domain_id}/dkim/complete MailDKIMRotate unary
ListQueue GET /api/v1/mail/queue MailQueueRead unary
FlushQueue POST /api/v1/mail/queue/flush MailQueueFlush unary
DeleteQueueEntry DELETE /api/v1/mail/queue/{queue_id} MailQueueDelete unary
ReportSpam POST /api/v1/mail/spam/report MailRspamdTrain unary
ReportHam POST /api/v1/mail/ham/report MailRspamdTrain unary
SearchDeliveryLog GET /api/v1/mail/delivery-log MailDeliveryLogRead unary
GetDovecotVersionPins GET /api/v1/mail/dovecot/version-pins MailDovecotVersionRead unary
SetDovecotVersionPins PUT /api/v1/mail/dovecot/version-pins MailDovecotVersionPin unary

/hostcraft.v1.MailService/ListMailboxes

/hostcraft.v1.MailService/CreateMailbox

/hostcraft.v1.MailService/GetMailbox

/hostcraft.v1.MailService/UpdateMailbox

/hostcraft.v1.MailService/DeleteMailbox

/hostcraft.v1.MailService/SetMailboxPassword

/hostcraft.v1.MailService/GetMailboxUsage

/hostcraft.v1.MailService/CreateWebmailSession

/hostcraft.v1.MailService/ListMailboxLogins

/hostcraft.v1.MailService/CreateMailboxLogin

/hostcraft.v1.MailService/ListForwarders

/hostcraft.v1.MailService/CreateForwarder

/hostcraft.v1.MailService/GetForwarder

/hostcraft.v1.MailService/UpdateForwarder

/hostcraft.v1.MailService/DeleteForwarder

/hostcraft.v1.MailService/ListMailingLists

/hostcraft.v1.MailService/CreateMailingList

/hostcraft.v1.MailService/GetMailingList

/hostcraft.v1.MailService/UpdateMailingList

/hostcraft.v1.MailService/DeleteMailingList

/hostcraft.v1.MailService/GetAutoresponder

/hostcraft.v1.MailService/SetAutoresponder

/hostcraft.v1.MailService/DeleteAutoresponder

/hostcraft.v1.MailService/ListFilters

/hostcraft.v1.MailService/CreateFilter

/hostcraft.v1.MailService/UpdateFilter

/hostcraft.v1.MailService/DeleteFilter

/hostcraft.v1.MailService/ReorderFilters

/hostcraft.v1.MailService/GetMailDomainConfig

/hostcraft.v1.MailService/UpdateMailDomainConfig

/hostcraft.v1.MailService/EnableMailDomain

/hostcraft.v1.MailService/SetCatchAll

/hostcraft.v1.MailService/RemoveCatchAll

/hostcraft.v1.MailService/GetDKIM

BeginDKIMRotation publishes a new selector alongside the active one. Call CompleteDKIMRotation once the new DNS record has propagated.

/hostcraft.v1.MailService/BeginDKIMRotation

/hostcraft.v1.MailService/CompleteDKIMRotation

/hostcraft.v1.MailService/ListQueue

/hostcraft.v1.MailService/FlushQueue

/hostcraft.v1.MailService/DeleteQueueEntry

/hostcraft.v1.MailService/ReportSpam

/hostcraft.v1.MailService/ReportHam

SearchDeliveryLog is Track Delivery: Postfix delivery outcomes for mail sent from or to the caller's domains. Server admins may omit account_id to search the whole server.

/hostcraft.v1.MailService/SearchDeliveryLog

/hostcraft.v1.MailService/GetDovecotVersionPins

/hostcraft.v1.MailService/SetDovecotVersionPins

MailSelfService is the self service surface for mailbox logins (role mailbox_user): their own mailbox, password, autoresponder, forwarding and filters. REST: /api/v1/mail/self.

Method REST route Permission Streaming
GetMailSelf GET /api/v1/mail/self MailSelfRead unary
ChangeMailSelfPassword POST /api/v1/mail/self/password MailSelfPasswordChange unary
GetMailSelfAutoresponder GET /api/v1/mail/self/autoresponder MailSelfRead unary
SetMailSelfAutoresponder PUT /api/v1/mail/self/autoresponder MailSelfAutoresponderSet unary
DeleteMailSelfAutoresponder DELETE /api/v1/mail/self/autoresponder MailSelfAutoresponderSet unary
GetMailSelfForwarding GET /api/v1/mail/self/forwarding MailSelfRead unary
SetMailSelfForwarding PUT /api/v1/mail/self/forwarding MailSelfForwardingManage unary
DeleteMailSelfForwarding DELETE /api/v1/mail/self/forwarding MailSelfForwardingManage unary
ListMailSelfFilters GET /api/v1/mail/self/filters MailSelfRead unary
CreateMailSelfFilter POST /api/v1/mail/self/filters MailSelfFilterManage unary
UpdateMailSelfFilter PATCH /api/v1/mail/self/filters/{id} MailSelfFilterManage unary
DeleteMailSelfFilter DELETE /api/v1/mail/self/filters/{id} MailSelfFilterManage unary

/hostcraft.v1.MailSelfService/GetMailSelf

/hostcraft.v1.MailSelfService/ChangeMailSelfPassword

/hostcraft.v1.MailSelfService/GetMailSelfAutoresponder

/hostcraft.v1.MailSelfService/SetMailSelfAutoresponder

/hostcraft.v1.MailSelfService/DeleteMailSelfAutoresponder

/hostcraft.v1.MailSelfService/GetMailSelfForwarding

/hostcraft.v1.MailSelfService/SetMailSelfForwarding

/hostcraft.v1.MailSelfService/DeleteMailSelfForwarding

/hostcraft.v1.MailSelfService/ListMailSelfFilters

/hostcraft.v1.MailSelfService/CreateMailSelfFilter

/hostcraft.v1.MailSelfService/UpdateMailSelfFilter

/hostcraft.v1.MailSelfService/DeleteMailSelfFilter

MailDeliverabilityService reports on sending reputation and runs deliverability tests. REST: /api/v1/mail/deliverability.

Method REST route Permission Streaming
ListPTRChecks GET /api/v1/mail/deliverability/ptr MailDeliverabilityRead unary
ListRBLChecks GET /api/v1/mail/deliverability/rbl MailDeliverabilityRead unary
ListBounceStats GET /api/v1/mail/deliverability/bounce-stats MailDeliverabilityRead unary
ListSpamTrapHits GET /api/v1/mail/deliverability/spam-traps MailDeliverabilityRead unary
ListReputation GET /api/v1/mail/deliverability/reputation MailDeliverabilityRead unary
ListWarmups GET /api/v1/mail/deliverability/warmup MailDeliverabilityRead unary
StartWarmup POST /api/v1/mail/deliverability/warmup MailWarmupManage unary
GetWarmup GET /api/v1/mail/deliverability/warmup/{ip} MailDeliverabilityRead unary
PauseWarmup POST /api/v1/mail/deliverability/warmup/{ip}/pause MailWarmupManage unary
ResumeWarmup POST /api/v1/mail/deliverability/warmup/{ip}/resume MailWarmupManage unary
CancelWarmup DELETE /api/v1/mail/deliverability/warmup/{ip} MailWarmupManage unary
ListMailTests GET /api/v1/mail/deliverability/test MailDeliverabilityRead unary
RunMailTest POST /api/v1/mail/deliverability/test/{domain_id} MailDeliverabilityTest unary
GetMailTest GET /api/v1/mail/deliverability/test/{id} MailDeliverabilityRead unary

/hostcraft.v1.MailDeliverabilityService/ListPTRChecks

/hostcraft.v1.MailDeliverabilityService/ListRBLChecks

/hostcraft.v1.MailDeliverabilityService/ListBounceStats

/hostcraft.v1.MailDeliverabilityService/ListSpamTrapHits

/hostcraft.v1.MailDeliverabilityService/ListReputation

/hostcraft.v1.MailDeliverabilityService/ListWarmups

/hostcraft.v1.MailDeliverabilityService/StartWarmup

/hostcraft.v1.MailDeliverabilityService/GetWarmup

/hostcraft.v1.MailDeliverabilityService/PauseWarmup

/hostcraft.v1.MailDeliverabilityService/ResumeWarmup

/hostcraft.v1.MailDeliverabilityService/CancelWarmup

/hostcraft.v1.MailDeliverabilityService/ListMailTests

RunMailTest sends a test message from the domain to an external scoring service; poll GetMailTest with the returned id.

/hostcraft.v1.MailDeliverabilityService/RunMailTest

/hostcraft.v1.MailDeliverabilityService/GetMailTest

Field Type Number Description
id string 1 -
mailbox_id string 2 -
subject string 3 -
body string 4 -
start_at google.protobuf.Timestamp 5 -
end_at google.protobuf.Timestamp 6 -
enabled bool 7 -
Field Type Number Description
domain_id string 1 -
Field Type Number Description
workflow_id string 1 -
new_selector string 2 -
new_public_key string 3 -
new_dns_record string 4 -
Field Type Number Description
domain_id string 1 -
hour google.protobuf.Timestamp 2 -
hard int64 3 -
soft int64 4 -
sent int64 5 -
rate double 6 -
updated_at google.protobuf.Timestamp 7 -
Field Type Number Description
current_password string 1 -
new_password string 2 -
Field Type Number Description
domain_id string 1 -
Field Type Number Description
active_selector string 1 -
Field Type Number Description
mailbox_id string 1 -
name string 2 -
conditions repeated MailFilterCondition 3 -
actions repeated MailFilterAction 4 -
priority int64 5 -
logic_all bool 6 -
enabled bool 7 -
Field Type Number Description
account_id string 1 -
domain_id string 2 -
source string 3 -
targets repeated string 4 -
keep_local bool 5 -
Field Type Number Description
name string 1 -
conditions repeated MailFilterCondition 2 -
actions repeated MailFilterAction 3 -
priority int64 4 -
logic_all bool 5 -
enabled bool 6 -
Field Type Number Description
id string 1 -
password string 2 -
display_name string 3 -
Field Type Number Description
account_id string 1 -
domain_id string 2 -
local_part string 3 -
password string 4 -
quota_bytes int64 5 -
Field Type Number Description
mailbox Mailbox 1 -
workflow_id string 2 -
Field Type Number Description
account_id string 1 -
domain_id string 2 -
name string 3 local part, or a full address on the domain
description string 4 -
owners repeated string 5 -
members repeated string 6 -
moderated bool 7 -
Field Type Number Description
id string 1 -
password string 2 -
Field Type Number Description
selector string 1 -
public_key string 2 -
dns_record string 3 -
Field Type Number Description
mailbox_id string 1 -
Field Type Number Description
id string 1 -
Field Type Number Description
id string 1 -

No fields.

Field Type Number Description
id string 1 -

No fields.

Field Type Number Description
id string 1 -
keep_maildir bool 2 -
Field Type Number Description
workflow_id string 1 -
logins_removed int64 2 -
Field Type Number Description
id string 1 -
Field Type Number Description
queue_id string 1 -
Field Type Number Description
time google.protobuf.Timestamp 1 -
queue_id string 2 -
message_id string 3 -
from string 4 -
to string 5 -
status string 6 -
dsn string 7 -
relay string 8 -
detail string 9 -
Field Type Number Description
installed string 1 -
config_version string 2 -
storage_version string 3 -
applied optional bool 4 -

Empty is returned by RPCs whose REST route answers with an empty object or 204 No Content.

No fields.

Field Type Number Description
domain_id string 1 -
account_id string 2 -

No fields.

Field Type Number Description
flushed int64 1 -
Field Type Number Description
id string 1 -
account_id string 2 -
domain_id string 3 -
source string 4 -
targets repeated string 5 -
keep_local bool 6 -
created_at google.protobuf.Timestamp 7 -
Field Type Number Description
mailbox_id string 1 -
Field Type Number Description
domain_id string 1 -

No fields.

Field Type Number Description
id string 1 -
Field Type Number Description
domain_id string 1 -

No fields.

No fields.

No fields.

Field Type Number Description
id string 1 -
Field Type Number Description
id string 1 -
Field Type Number Description
id string 1 -
Field Type Number Description
id string 1 -
Field Type Number Description
domain_id string 1 -
hours int64 2 -
Field Type Number Description
stats repeated BounceStat 1 -
Field Type Number Description
mailbox_id string 1 -
limit int64 2 -
offset int64 3 -
Field Type Number Description
filters repeated MailFilter 1 -
Field Type Number Description
account_id string 1 -
domain_id string 2 -
limit int64 3 -
offset int64 4 -
Field Type Number Description
forwarders repeated Forwarder 1 -

No fields.

Field Type Number Description
domain_id string 1 -
limit int64 2 -
Field Type Number Description
tests repeated MailTestResult 1 -
Field Type Number Description
id string 1 -
Field Type Number Description
logins repeated MailboxLogin 1 -
Field Type Number Description
account_id string 1 -
domain_id string 2 -
limit int64 3 -
offset int64 4 -
Field Type Number Description
mailboxes repeated Mailbox 1 -
Field Type Number Description
account_id string 1 -
domain_id string 2 -
limit int64 3 -
offset int64 4 -
Field Type Number Description
lists repeated MailingList 1 -

No fields.

Field Type Number Description
checks repeated PTRCheck 1 -
Field Type Number Description
state string 1 -
limit int64 2 -
offset int64 3 -
Field Type Number Description
entries repeated QueueEntry 1 -

No fields.

Field Type Number Description
checks repeated RBLCheck 1 -
Field Type Number Description
ip string 1 -
Field Type Number Description
scores repeated SenderScore 1 -
Field Type Number Description
limit int64 1 -
Field Type Number Description
hits repeated SpamTrapHit 1 -

No fields.

Field Type Number Description
schedules repeated WarmupSchedule 1 -
Field Type Number Description
host string 1 -
priority uint32 2 -
Field Type Number Description
id string 1 -
domain_id string 2 -
catch_all_target string 3 -
mx_managed bool 4 -
dkim_active_selector string 5 -
spam_threshold double 6 -
outbound_relay_host string 7 -
outbound_relay_username string 8 -
outbound_relay_has_password bool 9 -
custom_mx repeated MXRecord 10 -
Field Type Number Description
id string 1 -
mailbox_id string 2 -
name string 3 -
conditions repeated MailFilterCondition 4 -
actions repeated MailFilterAction 5 -
priority int64 6 -
logic_all bool 7 -
enabled bool 8 -
Field Type Number Description
kind string 1 -
args map<string, string> 2 -
Field Type Number Description
field string 1 -
operator string 2 -
value string 3 -
Field Type Number Description
mailbox Mailbox 1 -
autoresponder Autoresponder 2 -
forwarding Forwarder 3 -
filters repeated MailFilter 4 -
Field Type Number Description
autoresponder Autoresponder 1 -
Field Type Number Description
forwarding Forwarder 1 -
Field Type Number Description
id string 1 -
domain_id string 2 -
test_id string 3 -
target_address string 4 -
phase string 5 -
score double 6 -
spf_score double 7 -
dkim_score double 8 -
dmarc_score double 9 -
content_score double 10 -
blacklist_score double 11 -
breakdown google.protobuf.Struct 12 -
error_message string 13 -
created_at google.protobuf.Timestamp 14 -
updated_at google.protobuf.Timestamp 15 -
completed_at google.protobuf.Timestamp 16 -
Field Type Number Description
id string 1 -
account_id string 2 -
domain_id string 3 -
local_part string 4 -
full_address string 5 -
password_set bool 6 -
quota_bytes int64 7 -
used_bytes int64 8 -
autoresponder_enabled bool 9 -
created_at google.protobuf.Timestamp 10 -
Field Type Number Description
id string 1 -
email string 2 -
display_name string 3 -
mailbox_id string 4 -
created_at string 5 -
disabled bool 6 -
Field Type Number Description
quota_bytes int64 1 -
used_bytes int64 2 -

MailingList is a list address with owners and members, delivered by postfix alias expansion. When moderated the list address reaches the owners, who approve a post by resending it to post_address. request_address (-request) always reaches the owners.

Field Type Number Description
id string 1 -
account_id string 2 -
domain_id string 3 -
address string 4 -
description string 5 -
owners repeated string 6 -
members repeated string 7 -
moderated bool 8 -
post_address string 9 -
request_address string 10 -
created_at google.protobuf.Timestamp 11 -
updated_at google.protobuf.Timestamp 12 -
Field Type Number Description
ip string 1 -
expected_hostname string 2 -
ptr_hostname string 3 -
matched bool 4 -
forward_confirmed bool 5 -
error_message string 6 -
checked_at google.protobuf.Timestamp 7 -
Field Type Number Description
queue_id string 1 -
sender string 2 -
recipients repeated string 3 -
size int64 4 -
queued_at google.protobuf.Timestamp 5 -
delay int64 6 -
state string 7 -
last_error string 8 -
Field Type Number Description
ip string 1 -
rbl_name string 2 -
listed bool 3 -
response string 4 -
delisting_url string 5 -
checked_at google.protobuf.Timestamp 6 -
Field Type Number Description
domain_id string 1 -
Field Type Number Description
mailbox_id string 1 -
filter_ids repeated string 2 -
Field Type Number Description
domain_id string 1 -
Field Type Number Description
account_id string 1 -
q string 2 substring of sender, recipient, queue id or message id
status string 3 sent | deferred | bounced | expired | rejected
hours int64 4 look back this many hours
limit int64 5 -
Field Type Number Description
events repeated DeliveryEvent 1 -
Field Type Number Description
ip string 1 -
source string 2 -
score int64 3 -
category string 4 -
detail string 5 -
checked_at google.protobuf.Timestamp 6 -
Field Type Number Description
mailbox_id string 1 -
subject string 2 -
body string 3 -
start_at google.protobuf.Timestamp 4 -
end_at google.protobuf.Timestamp 5 -
enabled bool 6 -
Field Type Number Description
domain_id string 1 -
target string 2 -
Field Type Number Description
config_version string 1 -
storage_version string 2 -
Field Type Number Description
subject string 1 -
body string 2 -
start_at google.protobuf.Timestamp 3 -
end_at google.protobuf.Timestamp 4 -
enabled bool 5 -
Field Type Number Description
targets repeated string 1 -
keep_local bool 2 -
Field Type Number Description
id string 1 -
new_password string 2 -
Field Type Number Description
id string 1 -
domain_id string 2 -
mailbox_id string 3 -
sender string 4 -
recipient string 5 -
trap_source string 6 -
queue_id string 7 -
detected_at google.protobuf.Timestamp 8 -
notes string 9 -
Field Type Number Description
ip string 1 -
target_volume int64 2 -
Field Type Number Description
mailbox_id string 1 -
message_id string 2 -
Field Type Number Description
id string 1 -
name optional string 2 -
conditions repeated MailFilterCondition 3 -
replace_conditions bool 4 -
actions repeated MailFilterAction 5 -
replace_actions bool 6 -
priority optional int64 7 -
logic_all optional bool 8 -
enabled optional bool 9 -
Field Type Number Description
id string 1 -
targets repeated string 2 replaces the targets when non-empty
keep_local optional bool 3 -
Field Type Number Description
domain_id string 1 -
mx_managed optional bool 2 -
spam_threshold optional double 3 -
outbound_relay_host optional string 4 -
outbound_relay_username optional string 5 -
outbound_relay_password optional string 6 -
custom_mx repeated MXRecord 7 -
replace_custom_mx bool 8 -
Field Type Number Description
id string 1 -
name optional string 2 -
conditions repeated MailFilterCondition 3 replaces when non-empty
actions repeated MailFilterAction 4 replaces when non-empty
priority optional int64 5 -
logic_all optional bool 6 -
enabled optional bool 7 -
Field Type Number Description
id string 1 -
quota_bytes optional int64 2 -
autoresponder_enabled optional bool 3 -
Field Type Number Description
id string 1 -
description optional string 2 -
owners repeated string 3 replaces the owners when non-empty
members repeated string 4 replaces the members when non-empty
moderated optional bool 5 -
clear_members bool 6 empties the member list
Field Type Number Description
ip string 1 -
Field Type Number Description
ip string 1 -
target_volume int64 2 -
current_day int64 3 -
current_limit int64 4 -
phase string 5 -
started_at google.protobuf.Timestamp 6 -
last_advanced_at google.protobuf.Timestamp 7 -
completed_at google.protobuf.Timestamp 8 -
notes string 9 -
Field Type Number Description
token string 1 -
url string 2 -
expires_at google.protobuf.Timestamp 3 -

WorkflowAccepted is the body of every 202 response that only starts a workflow saga. Follow progress with WorkflowService.StreamWorkflow.

Field Type Number Description
workflow_id string 1 -