How to Move from Amazon SES to a Self-Hosted SMTP Server Without a Cold Start
Run SES and your own SMTP server side by side, warm up the new IP with capped volume, then cut over.
You cannot switch production email from Amazon SES to a new self-hosted SMTP server in one step. The new IP address has no sending history, and mailbox providers defer or junk a sudden stream of email from an IP they have never seen. The safe way is to run both in parallel: the new server takes a small, capped share of your traffic, SES sends the rest, and you raise the cap over a few weeks.
This guide covers the whole move - when it makes sense, how to prepare the server, how to split the traffic, and how to cut over. The examples use AWS SES and Postfix, but the same plan works from Postmark, Mailgun or SendGrid to any SMTP server you run yourself.
When the move makes sense
Amazon SES charges $0.10 per 1,000 emails. That is cheap at low volume, and it grows in a straight line:
| Emails per month | SES cost per month |
|---|---|
| 100,000 | $10 |
| 1,000,000 | $100 |
| 5,000,000 | $500 |
| 20,000,000 | $2,000 |
A self-hosted server costs a fixed amount for the machine, at any volume. At a few million emails a month, the difference pays for real engineering time.
The price is not the whole cost. With your own server, you own everything that SES did for you:
- IP reputation. One bad send can put your IP on a blocklist, and nobody else fixes it.
- Operations. Queue monitoring, TLS certificates, security updates, disk space.
- Bounce and complaint handling. SES reports these to you. Your own server writes them to a log.
Stay on SES if you send fewer than a few hundred thousand emails a month, or if nobody on the team wants to operate a mail server. The saving is too small.
One more check before you start: a dedicated IP needs steady volume to keep its reputation. AWS recommends about 1,000 emails a day to each mailbox provider to maintain a warmed-up IP. If your volume is far below that, a shared IP pool serves you better.
Why a new IP cannot take your traffic on day one
Mailbox providers such as Gmail and Outlook score every sending IP by its history. A new IP has none. The process of building that history is called IP warming: you start with a small volume and raise it step by step.
Google’s email sender guidelines say it directly. Increase the volume slowly, start with recipients who engage, send at a steady rate, and do not double your volume in one step. If emails bounce or are deferred, send less.
SES does the same for its own dedicated IPs. Its automatic warm-up takes 45 days.
The problem with transactional email
A warm-up schedule is easy for a newsletter. You pick a list of 50 people on day one and a list of 100 on day two.
Transactional email does not work that way. Your users trigger it, not you. A password reset must go out now, whether or not today’s quota is used up. The SendGrid documentation says the same: with transactional email you cannot control the rate at which emails trigger, so a strict schedule does not fit.
So the plan needs one more piece: a second route. Every email over the quota of the new server must go out through the old one, at once. That gives this setup:
┌─ new SMTP server (capped: 50, 100, 200 ... a day)
your application ─ split ┤
└─ Amazon SES (everything over the cap)
You can build the split yourself: a counter per hour and per day in Redis or your database, a check before each send, and two SMTP transports in your code. It is a small project, and you remove it again after the migration.
The other way is a layer that already has both pieces. SendStreak sits on top of your email backends and sends through them. Each email backend can have send limits per hour, per day and per month. An email backend that has reached a limit is passed over, and the email goes out through another one. The rest of this guide uses that setup. The steps for DNS and for the ramp are the same if you build the split yourself.
The plan
| Phase | New SMTP server | Amazon SES | Length |
|---|---|---|---|
| 1. Prepare | Not connected | 100% | Days |
| 2. Ramp | Capped share, raised daily | The rest | 3 to 5 weeks |
| 3. Majority | No cap | Capped share, lowered | 1 to 2 weeks |
| 4. Cut over | 100% | Standby or closed | - |
Step 1: Prepare the new server
The warm-up builds reputation only if the server looks right from the first email. Check each point before any production email goes through it.
A host that allows outbound port 25
Your server delivers to other mail servers on port 25. Most clouds block it by default: AWS EC2, Google Cloud, Azure, and DigitalOcean. Some remove the block on request. Ask before you build anything.
Also check the IP address itself against the common blocklists. A cloud IP can carry the history of its previous owner.
Forward and reverse DNS
Google requires valid forward and reverse DNS records for a sending IP. The IP must point to a hostname, and the hostname must point back to the same IP. You set the reverse (PTR) record at your hosting company, not in your own DNS zone.
dig +short -x 203.0.113.25
# mail.example.com.
dig +short A mail.example.com
# 203.0.113.25
Use the same hostname as the name in the EHLO greeting of the server. In Postfix that is myhostname:
myhostname = mail.example.com
smtp_tls_security_level = may
The second line turns on TLS for outgoing connections whenever the receiving server offers it. Google requires TLS for email to Gmail.
SPF, DKIM and DMARC
Both servers send for the same domain during the migration, so both must pass authentication at the same time.
- SPF: add the new IP to the SPF record of the domain in your from address. Keep everything that the record already has. Example:
v=spf1 ip4:203.0.113.25 include:amazonses.com ~all. - DKIM: create a new key pair on the new server and publish it under its own selector, for example
s2026._domainkey.example.com. The SES selectors stay where they are. A domain can have any number of selectors, and each server signs with its own. - DMARC: no change. The record is the same for both servers.
See how to set up SPF, DKIM, and DMARC for the full walkthrough. Send a test email to a Gmail address and open Show original. It must say PASS for SPF, DKIM and DMARC.
SMTP submission
Your sending layer connects to the new server as a client. Open a submission port (587 with STARTTLS, or 465 with implicit TLS), require a username and password, and make sure the server relays only for authenticated clients. Spammers find and abuse an open relay quickly.
Step 2: Connect both servers and cap the new one
In SendStreak, each server is one email backend:
- Add Amazon SES as an email backend, without send limits. The AWS SES guide has the details. Skip this if SES is connected already.
- Add the new server with the Other/Generic SMTP option. Use the same default sender address as on SES.
- On the new email backend, set Emails per day to 50 and Emails per hour to 5.
From this point, SendStreak picks one of the two email backends at random for each email. The new server gets about half of the emails until one of its limits is reached. After that, every email goes through SES until the next hour or the next day starts.
Set both limits. With a daily limit alone, the new server uses up its 50 emails in the first minutes after 00:00 UTC. The hourly limit spreads them over the day.
If your application calls SES directly today, this is the one code change of the migration: send through the SendStreak API or an SDK instead. Your templates move into SendStreak, and the SES account stays as it is.
Choose which emails warm up the IP
Google advises to start with recipients who engage. You cannot pick recipients for transactional email, but you can pick the email types.
A template with a preferred email backend always uses that one. So pin the low-engagement templates - digests, activity notifications, announcements - to SES for the first weeks. Leave the templates that people wait for without a preference: password resets, email verifications, receipts. Only those reach the new IP, and they are the emails that people open.
Step 3: Raise the cap
Raise the limits once a day at most. An increase of 25% a day doubles the volume about every three days, which stays inside Google’s advice not to double in one step.
| Day | Emails per day | Emails per hour |
|---|---|---|
| 1 | 50 | 5 |
| 7 | 194 | 20 |
| 14 | 929 | 93 |
| 21 | 4,438 | 444 |
| 28 | 21,168 | 2,117 |
There is no official schedule. Google publishes none, and the published examples of email providers differ from each other. Treat the table as a start and let the signals in the next step decide. The IP warm-up calculator makes the same table for your own target volume.
You can change the limits in the SendStreak dashboard, or with a small script that calls the REST API from cron. The docs guide Warming up a new email backend has the complete script.
Step 4: Watch the signals
Check these every day, before you raise the cap.
The mail log of the new server. Postfix writes one line per delivery attempt, with status=sent, status=deferred or status=bounced.
grep -c "status=sent" /var/log/mail.log
grep "status=deferred" /var/log/mail.log | tail -20
The path depends on your distribution. Read the reply text in the deferred lines. A 4xx reply that mentions rate limits or reputation means that the last step was too large. See SMTP status codes for how to read the codes.
The spam rate at Gmail. Google Postmaster Tools shows the share of your emails that Gmail users report as spam. Google asks senders to keep it below 0.10% and never to reach 0.30%.
The data at Microsoft. Smart Network Data Services (SNDS) shows per-IP data for email to Outlook.com addresses.
When a signal turns bad, do not raise the cap. Keep it for a few days, or go back one step. SES still carries everything over the cap, so a pause costs you nothing but time.
Step 5: Go past half, then cut over
While SES has no limits, the new server gets at most about half of your traffic, because each email picks one of the two at random. When the new server handles that half without deferrals, turn the caps around:
- Remove the send limits of the new email backend.
- Set send limits on the SES email backend - the volume that SES still has to carry.
- Lower the SES limits over one to two weeks.
Example with 20,000 emails a day: a limit of 5,000 a day on SES leaves 15,000 for the new server. Then 2,500. Then 1,000.
The last step is to remove SES from the rotation. Check that no template has SES as its preferred email backend, then delete the SES email backend in SendStreak.
Keep the SES account itself for a while. It costs nothing when it sends nothing, and it is your way back if the new server has a bad week.
What this setup does not do
Three limits to know before you rely on it:
- The cap does not rise by itself. Somebody, or a cron job, raises it. Nothing looks at your deferrals and decides for you.
- There is no failover on errors. SendStreak passes over an email backend that is at its send limit. It does not move an email to SES when the new server returns an error. Your server must be reliable from the first day.
- SendStreak is not free. It costs €2 per 10,000 emails after the first 100 emails a day. It is a layer on top of your servers, not a replacement for them, so count it in your comparison. See pricing.
Further reading
- What is IP warming?
- Warming up a new email backend - the step-by-step product guide with the ramp script
- How to set up SPF, DKIM, and DMARC
- What is SMTP relay?
- What are SMTP status codes?
- Best transactional email services for developers