Prompt
How do I trace a failed email send end to end?
Latest observation
To trace a failed email send end to end, follow the message through every hop: app, SMTP/API provider, queue, spam/DMARC checks, and recipient server. Here’s a practical workflow.
1) Start with the app-side event
Identify:
- When the send was attempted
- Who the sender and recipient were
- Which message/template was used
- Any error returned by the app
- A message ID / correlation ID if available
Check:
- Application logs
- Email service logs
- Background job/queue logs
- Retry logs
If your app uses an email provider API, capture the provider’s response:
- HTTP status
- Provider message ID
- Error code/message
2) Confirm whether the message left your system
If the app says “sent,” that may only mean “accepted by the mail service,” not delivered.
Look for:
- Queue job completed successfully
- SMTP conversation completed with
250 OK - API provider accepted the request
- Outbound mail relay logs showing handoff
If there’s no evidence the message left:
- Check authentication to SMTP/API
- Check timeouts
- Check queue backlogs
- Check connection failures
- Check rate limits or provider rejection
3) Trace using the message ID
A unique ID is the best way to correlate logs across systems.
Common IDs:
- Application/correlation ID
- SMTP
Message-ID - Provider message/event ID
- Postfix/Exchange/Sendmail queue ID
Use it to search:
- App logs
- MTA logs
- Provider dashboard/event logs
- Recipient-side logs if you have access
4) Inspect SMTP or provider events
If you use SMTP:
- Check outbound MTA logs for the session
- Look for:
5xxpermanent failure4xxtemporary deferral- TLS negotiation issues
- DNS lookup failures
- Relay denied / auth failed
If you use an email API:
- Check the provider event timeline:
- Accepted
- Deferred
- Delivered
- Bounce
- Dropped
- Complained
- Deferred by recipient
- Read the provider’s bounce reason or diagnostic code
5) Check DNS and sender authentication
Delivery problems often occur after acceptance due to authentication.
Verify:
- SPF: sender IP authorized?
- DKIM: signature valid?
- DMARC: policy alignment passing?
- Reverse DNS (PTR): matches sending domain/reputation expectations?
- MX records: recipient domain is configured properly?
Failures here may cause:
- Rejection
- Spam folder placement
- Silent dropping by providers
6) Review recipient-facing status
Possible outcomes after sending:
- Delivered
- Rejected
- Deferred
- Bounced
- Filtered to spam
- Quarantined
If you have a bounce:
- Read the full SMTP diagnostic text
- Identify whether it’s:
- mailbox full
- user unknown
- policy rejection
- content blocked
- reputation issue
- greylisting / temporary issue
7) Check content and reputation signals
Even valid mail can fail due to content or sender reputation.
Look at:
- Links/domains in the message
- Attachments
- Spammy subject/body wording
- IP/domain reputation
- Sending volume spikes
- New IP/domain without warmup
- Complaint rate / unsubscribe rate
8) Use headers for delivered or partially delivered messages
If you can get a copy of the message from:
- recipient
- mailbox logs
- provider trace tools
Inspect headers:
Message-IDReceived:chainAuthentication-Results:Return-Path:X-provider headers
Headers help identify:
- Which server handled each hop
- Whether SPF/DKIM/DMARC passed
- Where it was rejected or deferred
9) Correlate timestamps carefully
Email systems often use:
- Different time zones
- Delays due to queues/retries
- Batched provider updates
Build a timeline:
- App attempted send
- Queue accepted job
- MTA/API accepted message
- Recipient server accepted or deferred
- Provider later reported bounce/delivery
10) If you control the mail server, check these logs/tools
Depends on your stack:
Postfix
/var/log/maillog/var/log/mail.logpostqueue -ppostcat -q <queue_id>
Exim
- Exim main log
exim -bp
Exchange
- Message tracking logs
- Queue viewer
- Transport logs
Cloud providers
- SES / SendGrid / Mailgun / Postmark event logs
- Bounce and complaint webhooks
- Suppression lists
- Deliverability dashboards
11) Common failure patterns
- Auth failed: SMTP username/password/API key issue
- Relay denied: not allowed to send through that server
- DNS failure: bad MX, SPF, DKIM, or DNS timeout
- 550 rejected: recipient server refused message
- 451 deferred: temporary issue, retry later
- Suppressed: recipient on suppression list due to prior bounce/complaint
- Spam filtered: message accepted but hidden from inbox
- Content blocked: links, attachments, or policy triggers
12) A good end-to-end debugging checklist
- Confirm app attempted send
- Find message/correlation ID
- Verify queue or provider accepted it
- Check SMTP/API response
- Look for bounce/delivery events
- Review SPF/DKIM/DMARC results
- Inspect recipient rejection or spam filtering
- Check reputation, suppression, and content
- Build a full timestamped timeline
- Escalate to provider or recipient admin with logs
13) What to capture before escalating
Have ready:
- Sender address
- Recipient address
- Timestamp with timezone
- Subject line
- Message ID / correlation ID
- SMTP transcript or API response
- Bounce/diagnostic text
- Sending IP/domain
- Provider event logs
If you want, I can also give you:
- a Postfix/Exchange/SendGrid-specific tracing guide
- a step-by-step SMTP transcript checklist
- or a troubleshooting flowchart for failed sends.