Skip to main content

Quick Reference

Quick lookup tables for common EmailEngine configuration and API usage.

Webhook Events Summary

EventDescriptionWhen Triggered
messageNewNew email receivedEmail arrives in any folder
messageDeletedEmail deletedEmail moved to trash or permanently deleted
messageUpdatedEmail flags changedRead/unread, flagged, labels modified
messageSentEmail sent successfullyOutgoing email delivered to server
messageFailedEmail send failedDelivery error after retries
messageBounceBounce notificationBounce report received
messageDeliveryErrorDelivery issueSMTP error during send
messageComplaintSpam complaintAbuse report (ARF) received
messageMissingMessage not foundMessage disappeared from server
accountAddedAccount registeredNew account created via API
accountDeletedAccount removedAccount deleted from EmailEngine
accountInitializedAccount readyAccount fully initialized and synced
authenticationErrorAuth failedInvalid credentials or expired token
authenticationSuccessAuth succeededSuccessfully authenticated
connectErrorConnection errorNetwork or protocol error
mailboxNewMailbox createdNew folder detected
mailboxDeletedMailbox removedFolder deleted
mailboxResetMailbox resetFolder contents changed significantly
trackOpenEmail openedTracking pixel loaded
trackClickLink clickedTracked link accessed
listUnsubscribeUnsubscribe requestUser unsubscribed via List-Unsubscribe
listSubscribeSubscribe requestUser re-subscribed to a list

See Webhook Events Reference for complete payload documentation.

API Endpoints Summary

Account Management

MethodEndpointDescription
POST/v1/accountRegister new account
GET/v1/account/{account}Get account details
PUT/v1/account/{account}Update account
DELETE/v1/account/{account}Delete account
GET/v1/accountsList all accounts
PUT/v1/account/{account}/reconnectForce reconnect

Message Operations

MethodEndpointDescription
GET/v1/account/{account}/messagesList messages
GET/v1/account/{account}/message/{message}Get message details
GET/v1/account/{account}/message/{message}/sourceGet raw email
DELETE/v1/account/{account}/message/{message}Delete message
PUT/v1/account/{account}/message/{message}Update flags/move
GET/v1/account/{account}/searchSearch messages

Sending Emails

MethodEndpointDescription
POST/v1/account/{account}/submitSend email
GET/v1/outboxList queued emails
GET/v1/outbox/{queueId}Get queued email
DELETE/v1/outbox/{queueId}Cancel queued email

Mailbox Operations

MethodEndpointDescription
GET/v1/account/{account}/mailboxesList mailboxes
POST/v1/account/{account}/mailboxCreate mailbox
DELETE/v1/account/{account}/mailboxDelete mailbox

Attachments

MethodEndpointDescription
GET/v1/account/{account}/attachment/{attachment}Download attachment

Environment Variables

Required

VariableDescriptionExample
EENGINE_REDISRedis connection URLredis://localhost:6379/8
EENGINE_SECRETEncryption secret (32+ chars)openssl rand -hex 32

Server Configuration

VariableDefaultDescription
EENGINE_PORT3000HTTP API port
EENGINE_HOST127.0.0.1Bind address
EENGINE_WORKERS4IMAP worker threads
EENGINE_LOG_LEVELtraceLog level (trace/debug/info/warn/error)

Feature Flags

VariableDefaultDescription
EENGINE_DISABLE_SETUP_WARNINGSfalseDisable admin password warnings
EENGINE_REQUIRE_API_AUTHtrueRequire API authentication
EENGINE_LOG_RAWfalseLog raw IMAP/SMTP traffic (includes unmasked credentials - debug only)

Pre-configured Settings

VariableDescription
EENGINE_SETTINGSJSON string of runtime settings (webhooks, serviceUrl, etc.)
EENGINE_PREPARED_LICENSELicense key
EENGINE_PREPARED_TOKENPre-configured API token (exported hash)
EENGINE_PREPARED_PASSWORDPre-configured admin password (hash)
OAuth2 and Webhooks

OAuth2 applications and webhooks are configured via the Settings API or web interface, not environment variables. Use EENGINE_SETTINGS to pre-configure them at startup.

See Environment Variables for complete list.

Common Error Codes

HTTP Status Codes

CodeMeaningCommon Cause
200SuccessRequest completed
400Bad RequestInvalid parameters
401UnauthorizedMissing/invalid token
403ForbiddenInsufficient scope
404Not FoundAccount/message doesn't exist
409ConflictDuplicate account ID
429Too Many RequestsRate limited
500Server ErrorInternal error
502Bad GatewayUpstream provider error

Account Connection States

StateDescriptionAction
connectedActive connectionNormal operation
connectingEstablishing connectionWait for completion
syncingInitial sync in progressWait for completion
disconnectedConnection lostWill auto-reconnect
authenticationErrorCredentials invalidUpdate credentials or re-authenticate
connectErrorNetwork/server errorCheck server availability

Webhook Delivery Status

StatusDescription
queuedWaiting to send
activeCurrently sending
completedSuccessfully delivered
failedDelivery failed (will retry)

IMAP/SMTP Server Settings

Gmail

SettingValue
IMAP Serverimap.gmail.com
IMAP Port993 (SSL)
SMTP Serversmtp.gmail.com
SMTP Port587 (STARTTLS) or 465 (SSL)

Outlook / Microsoft 365

SettingValue
IMAP Serveroutlook.office365.com
IMAP Port993 (SSL)
SMTP Serversmtp.office365.com
SMTP Port587 (STARTTLS)

Yahoo Mail

SettingValue
IMAP Serverimap.mail.yahoo.com
IMAP Port993 (SSL)
SMTP Serversmtp.mail.yahoo.com
SMTP Port587 (STARTTLS)

OAuth2 Scopes

Gmail

ScopeAccess Level
https://mail.google.com/Full access (IMAP/SMTP)
https://www.googleapis.com/auth/gmail.readonlyRead-only (API only)
https://www.googleapis.com/auth/gmail.modifyRead/write (API only)
https://www.googleapis.com/auth/gmail.sendSend only (API only)

Microsoft / Outlook

ScopeAccess Level
https://outlook.office.com/IMAP.AccessAsUser.AllFull IMAP access
https://outlook.office.com/SMTP.SendSMTP send access
offline_accessRefresh token support

Special Folder Paths

Logical PathGmailOutlookStandard IMAP
\InboxINBOXInboxINBOX
\Sent[Gmail]/Sent MailSent ItemsSent
\Drafts[Gmail]/DraftsDraftsDrafts
\Trash[Gmail]/TrashDeleted ItemsTrash
\Junk[Gmail]/SpamJunk EmailJunk
\Archive[Gmail]/All MailArchiveArchive

Docker Quick Commands

# Start with Docker Compose
docker-compose up -d

# View logs
docker-compose logs -f emailengine

# Stop services
docker-compose down

# Update to latest
docker-compose pull && docker-compose up -d

# Check health
curl http://localhost:3000/health

API Authentication

# Using Bearer token
curl -H "Authorization: Bearer YOUR_TOKEN" \
http://localhost:3000/v1/accounts

# Using query parameter
curl "http://localhost:3000/v1/accounts?access_token=YOUR_TOKEN"

Common API Examples

Register Account (OAuth2)

curl -X POST http://localhost:3000/v1/account \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"account": "user123",
"email": "user@gmail.com",
"oauth2": {
"provider": "OAUTH_APP_ID",
"refreshToken": "REFRESH_TOKEN",
"auth": {"user": "user@gmail.com"}
}
}'

Send Email

curl -X POST http://localhost:3000/v1/account/user123/submit \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"to": [{"address": "recipient@example.com"}],
"subject": "Hello",
"text": "Hello World"
}'

Search Messages

curl "http://localhost:3000/v1/account/user123/search?search[subject]=invoice" \
-H "Authorization: Bearer $TOKEN"

Configure Webhooks

curl -X POST http://localhost:3000/v1/settings \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"webhooks": "https://your-app.com/webhooks",
"webhookEvents": ["messageNew", "messageSent"]
}'