# Gmail Is Bouncing Your App's Email? Here's How to Fix SPF, DKIM, and DMARC

Original title: How to set up SPF, DKIM, and DMARC for your sending domain

> Hacker News story 49922212 · language: en · submitted 2026-10-01
> Web version: https://zeli.app/story/49922212
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 89 · by [spy888](<https://news.ycombinator.com/user?id=spy888>) · 💬 29
[original](<https://mailfully.com/blog/spf-dkim-dmarc-setup>) · [HN discussion](<https://news.ycombinator.com/item?id=49922212>)

## Summary

If your automated emails land in spam or bounce with a 550 5.7.26 error, your sending domain probably lacks proper authentication. This guide walks through setting up SPF, DKIM, and DMARC DNS records, explaining how each check reads a different domain and why alignment with your visible From address matters. It includes concrete examples for a subdomain like mail.example.com, with verification steps and common pitfalls like duplicate SPF records.

## Key quote

> This explains the otherwise confusing result where SPF and DKIM both say “pass,” but DMARC says “fail.” The checks can succeed for the wrong domains.

## HN discussion (29 comments)

### [buredoranna](<https://news.ycombinator.com/item?id=49925582>)

> This looks like a pretty good resource.
>
> I'd like to add the following, which I continually reference and has led to repeatable success:
>
> https://www.linuxbabe.com/mail-server/setting-up-dkim-and-sp...
>
> And as far as confirming it works, I continually rely on sending to a gmail address.
>
> Under the three dots is "view original" which gives you
>
> SPF, DKIM, and DMARC results.
>
> (edit:formatting)

### [jcul](<https://news.ycombinator.com/item?id=49926037>)

> This is a cool site to visualise your SPF, DKIM, DMARC setup interactively.
>
> https://www.learndmarc.com/

### [gerdesj](<https://news.ycombinator.com/item?id=49926935>)

> This was not written by an email admin. Start with the real basics:
>
> Your MTA should announce itself and DNS should agree.  So your MTA says: HELO smtp.example.co.uk
>
> smtp.example.co.uk will resolve to an A record (say a.b.c.d) and a reverse lookup will also work:
>
> d.c.b.a.in-addr.arpa PTR smtp.example.co.uk.
>
> Remember this is all about reputation, so if you also DNSSEC sign example.co.uk, then you will look like you care about your domain reputation.
>
> Then do SPF, DKIM and DMARC.  Note how the example for SPF stops at ~all and not -all.  The rest is also superficial.
>
> Anyway, I run email systems that do the job properly and it is not trivial and certainly not formulaic.  There is no shortcut to getting an IP address/range trusted.
>
> The advice on that page is ... good as far as it goes but woefully inadequate for running an email system.  It's a good start.

---

## Cite

- Page: https://zeli.app/story/49922212
- Date: 2026-10-01
- Source: mailfully.com (https://mailfully.com/blog/spf-dkim-dmarc-setup)
- Hacker News: https://news.ycombinator.com/item?id=49922212

## Other languages

- zh: https://zeli.app/zh/story/49922212 · markdown: https://zeli.app/zh/story/49922212.md
- ja: https://zeli.app/ja/story/49922212 · markdown: https://zeli.app/ja/story/49922212.md
- ko: https://zeli.app/ko/story/49922212 · markdown: https://zeli.app/ko/story/49922212.md
- de: https://zeli.app/de/story/49922212 · markdown: https://zeli.app/de/story/49922212.md
- es: https://zeli.app/es/story/49922212 · markdown: https://zeli.app/es/story/49922212.md
- ru: https://zeli.app/ru/story/49922212 · markdown: https://zeli.app/ru/story/49922212.md
