Email Alerts
Deliver database audit alerts directly to email inboxes using SMTP or Amazon SES. Customizable HTML templates, multiple recipients, and optional digest batching.
SMTP & SES Support
Use your existing SMTP server or Amazon SES for reliable, scalable email delivery.
HTML Templates
Rich HTML emails with color-coded severity, structured details, and action buttons.
Multiple Recipients
Send alerts to multiple recipients with optional CC and per-severity routing.
Configuration Reference
1 Connection Settings
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| name | string | Yes | - | A unique name for this alert destination (e.g., "email-security-team") |
| provider | select | Yes | Alert provider - select "Email" | |
| enabled | boolean | No | true | Enable or disable alert delivery |
| delivery_method | select | Yes | - | Email delivery method: "smtp" or "ses" |
2a SMTP Settings (if delivery_method = smtp)
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| smtp_host | string | Yes | - | SMTP server hostname (e.g., "smtp.gmail.com", "smtp.office365.com") |
| smtp_port | number | No | 587 | SMTP server port (25, 465, 587) |
| smtp_username | string | Yes | - | SMTP authentication username |
| smtp_password | password | Yes | - | SMTP authentication password or app password |
| smtp_encryption | select | No | tls | Encryption method: "none", "tls", "ssl" |
2b Amazon SES Settings (if delivery_method = ses)
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| aws_region | string | Yes | - | AWS region for SES (e.g., "us-east-1", "eu-west-1") |
| aws_access_key_id | string | Yes | - | AWS access key ID with SES permissions |
| aws_secret_access_key | password | Yes | - | AWS secret access key |
| configuration_set | string | No | - | SES configuration set name for tracking (optional) |
3 Email Settings
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| from_address | string | Yes | - | Sender email address (must be verified for SES) |
| from_name | string | No | DB Audit Alerts | Sender display name |
| to_addresses | array | Yes | - | Recipient email addresses (comma-separated) |
| cc_addresses | array | No | - | CC recipient email addresses |
| reply_to | string | No | - | Reply-to email address |
| subject_prefix | string | No | [DB Audit] | Prefix added to all email subjects |
4 Alert Filtering
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| severity_filter | multiselect | No | all | Alert severities to send: critical, high, medium, low, info |
| alert_types | multiselect | No | all | Alert types: policy_violation, anomaly_detection, threshold_breach, classification_alert |
| database_filter | array | No | - | Limit to specific databases (empty = all databases) |
5 Delivery Settings
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| rate_limit | number | No | 30 | Maximum emails per minute (1-100) |
| batch_alerts | boolean | No | false | Batch multiple alerts into digest emails |
| batch_interval_minutes | number | No | 5 | Digest interval when batching is enabled |
| retry_attempts | number | No | 3 | Number of retry attempts on failure |
Setup Instructions
Choose Delivery Method
Select between SMTP and Amazon SES based on your infrastructure.
SMTP
- Works with any email provider
- Gmail, Office 365, SendGrid, etc.
- Simpler setup for small volumes
Amazon SES
- High deliverability and scalability
- Cost-effective for large volumes
- Delivery tracking with configuration sets
Test Email Delivery
Verify your credentials work before configuring DB Audit.
Test SMTP:
# Test SMTP connection with swaks
swaks --to test@example.com \
--from alerts@yourdomain.com \
--server smtp.gmail.com:587 \
--auth LOGIN \
--auth-user your-email@gmail.com \
--auth-password "your-app-password" \
--tls \
--body "Test alert from DB Audit"
Test SES:
# Test SES with AWS CLI
aws ses send-email \
--region us-east-1 \
--from alerts@yourdomain.com \
--to test@example.com \
--subject "Test Alert" \
--text "Test alert from DB Audit"
Configure in DB Audit
Add the email destination in the DB Audit dashboard.
- Navigate to Settings → Alert Destinations in DB Audit
- Click Add Destination
- Select Email as the provider
- Choose your delivery method (SMTP or SES)
- Enter your server/credentials and recipient addresses
- Configure filtering and delivery options
- Test the connection and save
Consider Digest Mode (Optional)
Enable batching to reduce email volume during high-activity periods.
Tip: Enable batch_alerts with a 5-minute interval to receive digest emails instead of individual alerts. This is especially useful for informational alerts.
Sample Alert Email
Alert emails include structured details and direct links to the DB Audit dashboard.
Plain Text Format
Subject: [DB Audit] High Severity: Bulk Data Access Detected
----------------------------------------------
DB AUDIT SECURITY ALERT
----------------------------------------------
Alert Type: Policy Violation
Severity: HIGH
Time: January 15, 2024 10:30:45 UTC
----------------------------------------------
SUMMARY
----------------------------------------------
User accessed more than 10,000 rows in a single query from
the customers table, triggering the Bulk Data Access policy.
----------------------------------------------
DETAILS
----------------------------------------------
Database: production-postgres
User: app_user
Client IP: 10.0.1.50
Application: backend-api
Query Type: SELECT
Object: public.customers
Rows: 15,000
Duration: 2.5 seconds
----------------------------------------------
POLICY
----------------------------------------------
Policy Name: Bulk Data Access Policy
Policy ID: policy_bulk_access
Threshold: 10,000 rows
----------------------------------------------
View in Dashboard:
https://app.dbaudit.ai/alerts/alert_abc123xyz
----------------------------------------------
This alert was sent by DB Audit
https://dbaudit.ai
Testing Your Integration
Test via Dashboard
- Go to Settings → Alert Destinations
- Find your Email destination
- Click the Test button
- Check your inbox for the test alert
- Also check spam/junk folders
Test via API
curl -X POST \
https://api.dbaudit.ai/v1/alerts/test \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"destination_id": "dest_abc123"}'
Troubleshooting
SMTP authentication failed
Check your username and password. For Gmail, you need an App Password, not your regular password.
- Enable 2FA on your Google account
- Generate an App Password at
myaccount.google.com/apppasswords - Use the App Password in DB Audit configuration
SES emails bouncing or in spam
Ensure your sending domain and email addresses are properly verified.
- Verify your domain in SES with DKIM records
- Set up SPF records for your domain
- Request production access if in sandbox mode
Connection timeout errors
The SMTP server may be unreachable from DB Audit's network.
- Check firewall rules allow outbound SMTP traffic
- Verify the correct port (587 for TLS, 465 for SSL)
- Some hosting providers block port 25
Emails not arriving at all
Check the alert destination status and delivery logs in DB Audit.
- View delivery logs at Settings → Alert Destinations → Logs
- Check if the destination is enabled
- Verify alert filters aren't blocking all alerts
Ready to Receive Email Alerts?
Start receiving database security alerts in your inbox in minutes.