docs/managed-datahub/smtp-email.md
:::note Availability This feature is available only on self-managed DataHub Enterprise clusters (BYOC / on-prem). :::
DataHub Enterprise (self-managed) can send notifications directly via any standard SMTP server. Use it when:
| Variable | Description |
|---|---|
EMAIL_PROVIDER | Must be set to smtp |
SMTP_HOST | SMTP server hostname (e.g., smtp.gmail.com, smtp-mail.outlook.com) |
SMTP_USERNAME | SMTP login username (typically your email address) |
SMTP_PASSWORD | SMTP login password (use an app password, not your regular password) |
export EMAIL_PROVIDER=smtp
export SMTP_HOST=smtp.gmail.com
export [email protected]
export SMTP_PASSWORD=your-app-password
| Variable | Default | Description |
|---|---|---|
SMTP_PORT | 587 | SMTP port (465 for SSL, 587 for STARTTLS) |
SMTP_USE_TLS | true | Enable STARTTLS (ignored for port 465 which uses SSL) |
FROM_EMAIL_ADDRESS | [email protected] | Sender email address |
FROM_EMAIL_TITLE | DataHub Cloud | Sender display name |
EMAIL_SINK_ENABLED | true | Enable/disable email notifications |
MAX_NOTIFICATION_RETRIES | 3 | Max retry attempts per notification |
DATAHUB_BASE_URL | http://localhost:9002 | DataHub URL used in email links |
NOTIFICATION_LOGO_URL | (built-in DataHub logo) | URL of a logo image shown in email templates (roughly square PNG/JPG, scaled to 60px wide; SVG is unreliable in email clients). Leave unset to keep the built-in DataHub logo. |
NOTIFICATION_FOOTER_TEXT | (built-in DataHub footer) | Footer signature text shown on every email. Leave unset to keep the built-in DataHub footer. |
SMTP_POOL_MIN_CONNECTIONS | 1 | Minimum pooled SMTP connections |
SMTP_POOL_MAX_CONNECTIONS | 5 | Maximum pooled SMTP connections |
SMTP_POOL_MAX_CONNECTION_AGE | 300 | Max connection age in seconds before retirement |
SMTP_POOL_MAX_CONNECTION_USES | 100 | Max uses per connection before retirement |
SMTP_POOL_CONNECTION_TIMEOUT | 30 | Timeout in seconds when waiting for a connection |
SMTP_CIRCUIT_BREAKER_ENABLED | true | Enable circuit breaker for fail-fast |
SMTP_CIRCUIT_BREAKER_FAILURE_THRESHOLD | 5 | Failures before opening circuit |
SMTP_CIRCUIT_BREAKER_RECOVERY_TIMEOUT | 60 | Seconds before attempting recovery |
LOG_LEVEL | INFO | Log verbosity (DEBUG for SMTP diagnostics) |
The logo and footer of SMTP email notifications are configurable (on self-managed DataHub Enterprise). Both are optional — leave them unset to keep the built-in DataHub logo and footer.
export NOTIFICATION_LOGO_URL=https://example.com/logo.png # roughly square PNG/JPG, scaled to 60px wide
export NOTIFICATION_FOOTER_TEXT="Acme Corp" # footer signature shown on every email
export SMTP_HOST=smtp.gmail.com
export SMTP_PORT=587
export SMTP_USE_TLS=true
Requires an App Password (not your regular password). Enable 2-Factor Authentication first.
</details> <details> <summary>Outlook / Office 365</summary>export SMTP_HOST=smtp-mail.outlook.com
export SMTP_PORT=587
export SMTP_USE_TLS=true
export SMTP_HOST=your-smtp-server.com
export SMTP_PORT=587 # or 465 for SSL, 25 for unencrypted
export SMTP_USE_TLS=true
Note: Port 465 uses SSL from connection start. Port 587 uses STARTTLS when SMTP_USE_TLS=true.
The SMTP system includes built-in reliability features that require no additional configuration:
All of these are configurable via the environment variables listed above.
SMTP metrics are exported via the /metrics endpoint:
| Metric | Type | Labels | Description |
|---|---|---|---|
smtp_emails_total | Counter | template_type, status | Total emails sent (success/failure) |
smtp_delivery_duration_seconds | Histogram | template_type, status | Per-email delivery time including retries |
smtp_circuit_breaker_trips_total | Counter | - | Times circuit breaker tripped to open |
smtp_pool_exhaustion_total | Counter | - | Times connection pool was fully exhausted |
GET /private/notifications/smtp/health
kubectl port-forward -n datahub svc/datahub-acryl-datahub-integrations 9003:9003
curl -s http://localhost:9003/private/notifications/smtp/health | jq .
Key metrics to alert on:
| Metric | Alert Condition | Meaning |
|---|---|---|
status | "unhealthy" or "degraded" | System has issues |
circuit_breaker.state | "open" | SMTP server is down |
connection_pool.utilization | > 0.8 | Pool near capacity |
connection_pool.failure_rate | > 0.1 | 10%+ connection failures |
SMTP_USE_TLS=true for STARTTLS.Set LOG_LEVEL=DEBUG for verbose SMTP diagnostics.