The 429 rate limit trap: Why default Supabase Auth breaks in production
Supabase is the primary open-source backend-as-a-service (BaaS) for modern web applications, combining PostgreSQL, Row Level Security (RLS), real-time database listeners, and instant GoTrue authentication.
However, every newly initialized Supabase project ships with a strict production ceiling: Supabase built-in mail server is hard-capped at strictly 2 auth emails per hour for testing. This built-in sender dispatches via shared IP infrastructure from noreply@mail.app.supabase.io with zero custom domain DKIM authentication.
Once you configure Custom SMTP, Supabase automatically raises this baseline limit to 30 emails per hour. But for production scale, you must also navigate to Authentication → Rate Limits in the Supabase dashboard to increase the hourly ceiling to match your user signup velocity.
Without custom SMTP, the moment your product receives concurrent sign-ups, launches on Product Hunt, or invites team members, your authentication pipeline crashes with an HTTP 429 rate limit error:
- Unverified shared sender domain: Default confirmation emails originate from noreply@mail.app.supabase.io, which fails corporate spam filters and triggers phishing warnings in Microsoft 365.
- Two distinct rate limits: Supabase enforces 2 emails/hour built-in, and 30 emails/hour default when custom SMTP is enabled. Production apps must raise this under Project Settings > Authentication > Rate Limits.
- Zero SPF, DKIM, or DMARC alignment: Because the envelope sender does not match your application domain, Google and Yahoo reject or route messages directly to the junk folder.
- Signup funnel drop-off: When confirmation emails take more than 30 seconds to arrive or get rate-limited, user drop-off exceeds 45%.
{
"code": 429,
"error_code": "email_rate_limit_exceeded",
"msg": "For security purposes, you can only request this once every 60 seconds."
}Supabase Auth architecture: GoTrue, SMTP relay, and transaction queues
Supabase Auth is powered by GoTrue, an open-source Go daemon that manages user identities, refresh tokens, and authentication events.
When a user requests a magic link, password reset, or email change, GoTrue constructs a MIME email containing an authorization token and connects to your configured SMTP relay over port 587 using STARTTLS.
By pointing Supabase GoTrue to SadaSend edge SMTP relay (smtp.sadasend.com), authentication messages bypass shared rate limits and are queued with low dispatch latency. View complete setup parameters in our SMTP documentation, test your DNS records with our free SPF record checker, and start free with 6,000 monthly auth emails on our developer pricing.
| Feature / Limit | Default Supabase Mailer | SadaSend Custom SMTP |
|---|---|---|
| Hourly Email Rate Limit | 2 emails / hour (Built-in) -> 30/hr default SMTP (Adjustable in Auth > Rate Limits) | Unlimited / Burstable within tier |
| Sender Domain | noreply@mail.app.supabase.io | auth@yourdomain.com (100% Branded) |
| DKIM & SPF Alignment | Shared (No custom records) | 2048-bit RSA + Domain-level SPF |
| DMARC Compliance | Fails strict p=reject policies | 100% Aligned (Passes Gmail/Yahoo 2026) |
| Delivery Latency | 15s to 4 minutes (Shared queue) | fast ingestion & delivery |
| Bounce & Suppression Protection | Basic bounce logging | Automatic pre-flight suppression firewall |
Step-by-step: Configuring SadaSend Custom SMTP in Supabase Dashboard
Connecting SadaSend to Supabase takes less than two minutes. Follow these exact steps in your Supabase Management Console:
1. Log in to your Supabase project dashboard at supabase.com/dashboard.
2. Navigate to Project Settings (gear icon in sidebar) > Authentication.
3. Scroll down to the SMTP Settings section and toggle Enable Custom SMTP to ON.
4. Fill in the connection credentials according to the table below:
| Configuration Parameter | Value to Enter | Notes |
|---|---|---|
| Sender Email | auth@yourcompany.com | Must match a verified domain in your SadaSend account |
| Sender Name | Your Brand Name | Displayed in the user email client inbox header |
| Host | smtp.sadasend.com | SadaSend SMTP relay (Germany (EU)) |
| Port | 587 | Standard ESMTP port with opportunistic STARTTLS |
| Minimum TLS Version | 1.2 | Guarantees end-to-end transport encryption |
| Username | apikey | Literal string "apikey" (lowercase) |
| Password | sada_live_sk_your_key_here | Your production SadaSend API Key from dashboard |
Local development configuration: supabase/config.toml
If you develop locally using the Supabase CLI (supabase start), you should configure your local environment to mirror production. This ensures your local signup and password reset flows test actual SMTP delivery rather than relying on InBucket.
Add the following block to your project supabase/config.toml file:
# supabase/config.toml
[auth.email]
enable_signup = true
double_confirm_changes = true
enable_confirmations = true
[auth.email.smtp]
host = "smtp.sadasend.com"
port = 587
user = "apikey"
pass = "env(SADASEND_API_KEY)"
admin_email = "auth@yourdomain.com"
sender_name = "Your App Local"When you run supabase start, the local GoTrue container reads the SADASEND_API_KEY environment variable and dispatches real test emails directly through your authenticated domain.
Production-ready auth email templates (Magic Link & Confirmation)
Default Supabase email templates use raw unstyled HTML that looks untrustworthy. You can customize templates in Supabase under Authentication > Email Templates.
Here is an accessible, responsive, dark-mode ready Magic Link template designed with inline CSS and GoTrue template variables:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Your Magic Sign-In Link</title>
</head>
<body style="margin: 0; padding: 32px 16px; background-color: #0c0d0e; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #f4f4f5;">
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width: 520px; background-color: #18181b; border: 1px solid #27272a; border-radius: 8px; padding: 32px;">
<tr>
<td>
<h1 style="font-size: 20px; font-weight: 700; margin: 0 0 16px; color: #ffffff;">Sign in to {{ .SiteURL }}</h1>
<p style="font-size: 14px; line-height: 1.6; color: #a1a1aa; margin: 0 0 24px;">
Click the secure button below to authenticate. This single-use link expires in 15 minutes.
</p>
<table border="0" cellpadding="0" cellspacing="0" style="margin: 0 0 24px;">
<tr>
<td align="center" style="border-radius: 6px; background-color: #10b981;">
<a href="{{ .ConfirmationURL }}" target="_blank" rel="noopener noreferrer" style="display: inline-block; padding: 12px 24px; font-size: 14px; font-weight: 600; color: #000000; text-decoration: none; border-radius: 6px;">
Authenticate Now →
</a>
</td>
</tr>
</table>
<p style="font-size: 12px; line-height: 1.5; color: #71717a; margin: 0;">
If you did not request this email, you can safely ignore it. Token: <code style="font-family: monospace; color: #d4d4d8;">{{ .Token }}</code>
</p>
</td>
</tr>
</table>
</body>
</html>Dispatching event emails from Supabase Edge Functions (Deno)
While Supabase GoTrue manages signups and password resets via SMTP, transactional notifications (such as billing confirmations, team invitations, and audit alerts) are best dispatched from Supabase Edge Functions.
Using SadaSend REST API directly from Deno eliminates SMTP handshake latency and edge socket overhead. Here is an Edge Function that triggers an invite email using Deno native fetch:
// supabase/functions/send-team-invite/index.ts
import { serve } from 'https://deno.land/std@0.168.0/http/server.ts';
interface InvitePayload {
recipientEmail: string;
teamName: string;
inviterName: string;
inviteToken: string;
}
serve(async (req: Request) => {
if (req.method !== 'POST') {
return new Response('Method Not Allowed', { status: 405 });
}
const apiKey = Deno.env.get('SADASEND_API_KEY');
if (!apiKey) {
return new Response(JSON.stringify({ error: 'SADASEND_API_KEY missing' }), { status: 500 });
}
const { recipientEmail, teamName, inviterName, inviteToken }: InvitePayload = await req.json();
const inviteUrl = `https://yourcompany.com/accept-invite?token=${inviteToken}`;
const res = await fetch('https://api.sadasend.com/emails', {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
to: recipientEmail,
from: 'team@yourcompany.com',
subject: `${inviterName} invited you to join ${teamName}`,
html: `<p>You have been invited to collaborate on <strong>${teamName}</strong>.</p><p><a href="${inviteUrl}">Accept Invitation</a></p>`,
text: `${inviterName} invited you to join ${teamName}. Accept here: ${inviteUrl}`,
}),
});
const result = await res.json();
if (!res.ok) {
return new Response(JSON.stringify({ error: result.message || 'Delivery failure' }), {
status: res.status,
headers: { 'Content-Type': 'application/json' },
});
}
return new Response(JSON.stringify({ success: true, messageId: result.id }), {
status: 200,
headers: { 'Content-Type': 'application/json' },
});
});100% DMARC, SPF, and DKIM alignment for auth emails
Authentication emails face the highest scrutiny by anti-spoofing algorithms at Gmail, Outlook, and Apple Mail. If your domain lacks aligned DKIM or publishes an ambiguous SPF record, magic links will be dropped or quarantined.
Verify that your DNS host publishes the following 3 authoritative records for your sending domain (e.g. yourcompany.com):
- SPF Record (TXT): "v=spf1 include:spf.sadasend.com ~all" - Authorizes SadaSend outbound mail servers.
- DKIM Record (TXT): Publish the 2048-bit public key shown in your dashboard at sada1._domainkey.yourcompany.com.
- DMARC Policy (TXT): "_dmarc.yourcompany.com" with value "v=DMARC1; p=reject; pct=100; rua=mailto:dmarc@yourcompany.com" to block any unauthorized spoofing.
Production troubleshooting matrix: Fixing common Supabase SMTP errors
If you encounter connection issues when enabling Custom SMTP in Supabase, reference this diagnostic error matrix:
| Observed Error / Code | Root Cause | Resolution Step |
|---|---|---|
| 535 Authentication failed | Invalid API key or typed literal password | Verify username is "apikey" and password starts with sada_live_sk_. |
| 550 Sender unverified | Sender email does not match verified domain | Add and verify your sending domain in the SadaSend dashboard first. |
| Timeout connecting to port 465 | GoTrue default connection expects STARTTLS | Use Port 587 with STARTTLS enabled instead of port 465 SSL. |
| 429 Rate limit still triggered | Custom SMTP toggle was not saved in Supabase | Toggle "Enable Custom SMTP" to ON and click the green Save button at the bottom of the page. |
| Email delivered to Spam/Junk | Missing DMARC or mismatched from address | Ensure "Sender Email" in Supabase exactly matches your verified DKIM domain. |
Frequently Asked Questions
Send transactional emails in under 3 minutes
EU-hosted delivery, custom SMTP relay, 100% SPF/DKIM alignment, and automated suppression firewalls. 6,000 free sends every month without a credit card.
Lead integration engineer at SadaSend. Writes about full-stack web frameworks, React Email template compilation, and connecting transactional mail pipelines to Next.js, FastAPI, and Supabase.