NevarMail

Providers

Configure email providers, monitor health, and manage rate limits.

Providers are the email delivery services that NevarMail uses to send your emails. You can configure multiple providers for redundancy and automatic failover.

Supported providers

ProviderTypeEnvironment Variables
SendGridsendgridSENDGRID_API_KEY
MailgunmailgunMAILGUN_API_KEY, MAILGUN_DOMAIN
Amazon SESsesAWS_SES_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
PostmarkpostmarkPOSTMARK_SERVER_TOKEN
SMTPsmtpSMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS

Add a provider

POST /api/providers
{
  "name": "SendGrid Production",
  "type": "sendgrid",
  "config": { "region": "us" },
  "priority": 0,
  "rateLimitPerMinute": 100,
  "rateLimitPerHour": 5000,
  "rateLimitPerDay": 50000
}

Provider fields

FieldTypeRequiredDescription
namestringYesDisplay name for this provider
typestringYesProvider type (see table above)
configobjectNoProvider-specific configuration
prioritynumberNoPriority for provider selection (lower = higher priority)
rateLimitPerMinutenumberNoMaximum sends per minute
rateLimitPerHournumberNoMaximum sends per hour
rateLimitPerDaynumberNoMaximum sends per day

List providers

GET /api/providers

Returns all configured providers with their health status and current usage counts.

Provider health

NevarMail monitors each provider's health status automatically. You can also check a specific provider's status:

GET /api/providers/:id/status
{
  "id": "...",
  "name": "SendGrid Production",
  "isHealthy": true,
  "lastHealthCheck": "2026-03-22T12:00:00.000Z",
  "usageMinute": 5,
  "usageHour": 120,
  "usageDay": 1500,
  "rateLimitPerMinute": 100,
  "rateLimitPerHour": 5000,
  "rateLimitPerDay": 50000
}

Test a connection

Verify that a provider is correctly configured and reachable:

POST /api/providers/:id/test
{
  "success": true,
  "latencyMs": 750,
  "message": "Successfully connected to SendGrid"
}

Update a provider

PUT /api/providers/:id
{
  "rateLimitPerDay": 100000,
  "priority": 1
}

Delete a provider

DELETE /api/providers/:id

Returns { "removed": true } on success.

Auto-detection

NevarMail can detect which providers are available based on environment variables:

GET /api/config/providers
[
  { "name": "SendGrid", "type": "sendgrid", "configured": true },
  { "name": "Mailgun", "type": "mailgun", "configured": false },
  { "name": "AWS SES", "type": "ses", "configured": false },
  { "name": "Postmark", "type": "postmark", "configured": false }
]

Failover

When a provider becomes unhealthy or reaches its rate limit, NevarMail automatically routes emails to the next available provider based on priority. This happens transparently -- your sending code does not need to change.

Configure multiple providers with different priorities to enable automatic failover:

ProviderPriorityRole
SendGrid0Primary
Mailgun1Secondary
Amazon SES2Tertiary

On this page