🔒 Bezpieczeństwo i poczta

Dlaczego maile z firmowej domeny trafiają do spamu. SPF, DKIM i DMARC po ludzku

3rekordy DNS do ustawienia
1rekord SPF na domenę, nie więcej
10limit zapytań DNS w SPF

Wysyłasz ofertę, klient mówi, że nic nie doszło. Znajduje ją po tygodniu w spamie. Albo gorzej: klient dostaje „od Ciebie” fakturę z nowym numerem konta, której nigdy nie wysłałeś. W obu przypadkach przyczyna jest zwykle ta sama. Domena firmy nie mówi skrzynkom odbiorców, kto ma prawo wysyłać w jej imieniu.

Robią to trzy rekordy w DNS: SPF, DKIM i DMARC. Ustawia się je raz, zajmuje to godzinę, a potem działają same. Poniżej opisujemy, co robi każdy z nich, w jakiej kolejności je ustawić i jakie błędy widzimy najczęściej.

Nie wiesz, jak to wygląda u Ciebie? Darmowy skan sprawdzi SPF, DKIM i DMARC Twojej domeny w kilkanaście sekund, bez rejestracji.

Dlaczego to ważne właśnie teraz

Od lutego 2024 roku Gmail i Yahoo wymagają od firm wysyłających dużo maili ustawienia wszystkich trzech rekordów, a od pozostałych co najmniej SPF albo DKIM. W 2025 roku podobne zasady wprowadził Microsoft dla skrzynek Outlook.com. Maile bez tych rekordów nie znikają od razu, ale coraz częściej lądują w spamie albo są odrzucane. Skrzynki po prostu nie mają jak odróżnić Twojego prawdziwego maila od podróbki.

SPF: lista serwerów, które mogą wysyłać z Twojej domeny

SPF to jeden rekord TXT w DNS domeny. Wypisuje serwery, które wolno uznać za Twoje. Przykład dla firmy, która ma pocztę w Google Workspace i wysyła newsletter z innego narzędzia:

Gdzie masz pocztęCo wpisać w SPF
Google Workspaceinclude:_spf.google.com
Microsoft 365include:spf.protection.outlook.com
OVH (MX Plan, Email Pro)include:mx.ovh.com

Cały rekord wygląda wtedy na przykład tak: v=spf1 include:_spf.google.com include:[narzędzie do newslettera] -all. Końcówka -all mówi: wszystko spoza listy odrzuć. Łagodniejsza wersja ~all oznacza „podejrzane”, co na start też jest w porządku.

Trzy zasady, które najczęściej są łamane:

DKIM: podpis, którego nie da się podrobić

DKIM dodaje do każdego maila podpis cyfrowy. Klucz publiczny leży w Twoim DNS, a prywatny u dostawcy poczty. Skrzynka odbiorcy sprawdza podpis i wie, że mail nie został zmieniony po drodze i naprawdę wyszedł z Twojego systemu.

DKIM włącza się w panelu dostawcy poczty. Google Workspace, Microsoft 365, OVH i narzędzia do newsletterów mają na to osobną opcję. Dostawca pokazuje rekord do wklejenia w DNS, najczęściej o nazwie w stylu selektor._domainkey.twojafirma.pl. Każde narzędzie wysyłające maile ma swój klucz, więc przy trzech nadawcach masz trzy rekordy DKIM. To normalne.

DMARC: co zrobić z mailem, który nie przeszedł kontroli

DMARC spina SPF i DKIM. Mówi skrzynkom odbiorców, co robić, gdy ktoś wysyła maila z Twoją domeną w polu „Od”, a nie przechodzi ani SPF, ani DKIM. Ma trzy poziomy:

Rekord zaczynasz od obserwacji: v=DMARC1; p=none; rua=mailto:dmarc@twojafirma.pl, wpisany jako TXT pod nazwą _dmarc.twojafirma.pl. Przez 2-4 tygodnie na podany adres przychodzą raporty, z których widać, kto wysyła maile z Twoją domeną. Zwykle wychodzi wtedy zapomniany system, który trzeba dopisać do SPF albo DKIM. Dopiero potem zaostrzasz zasadę do quarantine, a na końcu do reject.

Samo p=none nikogo nie chroni. To etap przejściowy, a wiele firm zatrzymuje się na nim na lata, bo nikt nie czyta raportów.

Błędy, które widzimy najczęściej

  1. Brak DMARC. Każdy może wysłać maila „od prezesa” do księgowości albo „od firmy” do klientów i nic tego nie zatrzyma.
  2. Dwa rekordy SPF. Zwykle drugi dodał ktoś przy podłączaniu nowego narzędzia, zamiast dopisać je do pierwszego.
  3. SPF, który blokuje własną pocztę. Rekord v=spf1 -all oznacza „z tej domeny nikt nie wysyła”. Ma sens dla domeny bez poczty, ale nie dla domeny, z której piszecie do klientów. Znaleźliśmy ten błąd u siebie, audytując własną domenę. Maile dochodziły tylko dlatego, że działał DKIM.
  4. DMARC na p=none od lat i raporty wysyłane na adres, którego nikt nie sprawdza.
  5. Zapomniani nadawcy: sklep, program do faktur albo formularz na stronie wysyłają maile z Twojej domeny bez SPF i DKIM, więc lądują w spamie klientów.

Kolejność, w której warto to zrobić

  1. Spisz wszystkie systemy, które wysyłają maile z Twoją domeną w polu „Od”.
  2. Ułóż jeden rekord SPF ze wszystkimi nadawcami.
  3. Włącz DKIM u każdego nadawcy i wklej rekordy do DNS.
  4. Dodaj DMARC z p=none i adresem na raporty.
  5. Po 2-4 tygodniach przejrzyj raporty, dopisz brakujących nadawców i zmień zasadę na quarantine, potem na reject.

Zmiany w DNS robi się w panelu, w którym jest domena: u rejestratora albo w Cloudflare. Przed każdą zmianą zapisz starą wartość rekordu, żeby móc ją przywrócić w minutę.

Skąd te informacje

Wymagania dla nadawców opisują same skrzynki, m.in. wytyczne Google dla nadawców. Limit 10 zapytań DNS i zasada jednego rekordu SPF pochodzą ze specyfikacji SPF (RFC 7208), a poziomy DMARC ze specyfikacji DMARC (RFC 7489). Przykład błędu SPF pochodzi z audytu naszej własnej domeny, zrobionego tym samym skanerem, który udostępniamy za darmo.

Poradnik · stan 09.2026 · źródła w treści

Sprawdź swoją domenę za darmo

Skan pokaże stan SPF, DKIM i DMARC, certyfikatu SSL i nagłówków strony. Wynik w kilkanaście sekund, bez rejestracji.

Sprawdź zabezpieczenia →

Wolisz, żebyśmy ustawili to za Ciebie? Wypełnij brief albo napisz na kontakt@aimatic.works

← Wszystkie wpisy

🔒 Security and email

Why emails from your company domain end up in spam. SPF, DKIM and DMARC in plain language

3DNS records to set up
1SPF record per domain, no more
10DNS lookup limit in SPF

You send an offer, the client says nothing arrived. They find it a week later in spam. Or worse: the client receives an invoice "from you" with a new bank account number that you never sent. In both cases the cause is usually the same. Your company domain does not tell recipients' mailboxes who is allowed to send on its behalf.

Three DNS records do that: SPF, DKIM and DMARC. You set them up once, it takes an hour, and then they work on their own. Below we describe what each of them does, in which order to set them up and which mistakes we see most often.

Not sure what it looks like for your domain? A free scan checks your domain's SPF, DKIM and DMARC in a few seconds, without registration.

Why this matters right now

Since February 2024 Gmail and Yahoo require companies that send a lot of email to set up all three records, and everyone else to have at least SPF or DKIM. In 2025 Microsoft introduced similar rules for Outlook.com mailboxes. Emails without these records do not disappear right away, but more and more often they land in spam or get rejected. Mailboxes simply have no way to tell your real email from a forgery.

SPF: the list of servers allowed to send from your domain

SPF is a single TXT record in your domain's DNS. It lists the servers that may be treated as yours. An example for a company that has email in Google Workspace and sends a newsletter from another tool:

Where your email is hostedWhat to put in SPF
Google Workspaceinclude:_spf.google.com
Microsoft 365include:spf.protection.outlook.com
OVH (MX Plan, Email Pro)include:mx.ovh.com

The full record then looks, for example, like this: v=spf1 include:_spf.google.com include:[newsletter tool] -all. The -all ending says: reject everything not on the list. The softer version ~all means "suspicious", which is also fine to start with.

Three rules that are broken most often:

DKIM: a signature that cannot be forged

DKIM adds a digital signature to every email. The public key sits in your DNS, the private one with your email provider. The recipient's mailbox checks the signature and knows that the email was not altered on the way and really came from your system.

DKIM is switched on in your email provider's panel. Google Workspace, Microsoft 365, OVH and newsletter tools each have a separate option for it. The provider shows a record to paste into DNS, usually named something like selector._domainkey.yourcompany.com. Each sending tool has its own key, so with three senders you have three DKIM records. That is normal.

DMARC: what to do with an email that failed the checks

DMARC ties SPF and DKIM together. It tells recipients' mailboxes what to do when someone sends an email with your domain in the "From" field and it passes neither SPF nor DKIM. It has three levels:

You start with monitoring: v=DMARC1; p=none; rua=mailto:dmarc@yourcompany.com, added as a TXT record named _dmarc.yourcompany.com. For 2-4 weeks reports arrive at that address, showing who sends email with your domain. Usually a forgotten system turns up that needs to be added to SPF or DKIM. Only then do you tighten the policy to quarantine, and finally to reject.

p=none on its own protects nobody. It is a transition stage, and many companies stay on it for years because nobody reads the reports.

The mistakes we see most often

  1. No DMARC. Anyone can send an email "from the CEO" to accounting or "from the company" to customers, and nothing will stop it.
  2. Two SPF records. Usually someone added the second one when connecting a new tool, instead of adding it to the first.
  3. SPF that blocks your own email. The record v=spf1 -all means "nobody sends from this domain". It makes sense for a domain without email, but not for a domain you use to write to customers. We found this mistake on our own domain while auditing it. Emails only got through because DKIM was working.
  4. DMARC on p=none for years, with reports sent to an address nobody checks.
  5. Forgotten senders: the online shop, the invoicing software or the website form send emails from your domain without SPF and DKIM, so they land in your customers' spam.

The order in which to do it

  1. List every system that sends email with your domain in the "From" field.
  2. Build one SPF record containing all senders.
  3. Enable DKIM for every sender and paste the records into DNS.
  4. Add DMARC with p=none and an address for reports.
  5. After 2-4 weeks review the reports, add the missing senders and change the policy to quarantine, then to reject.

DNS changes are made in the panel where your domain is managed: at the registrar or in Cloudflare. Before every change, write down the old value of the record so you can restore it in a minute.

Where this information comes from

Sender requirements are described by the mailbox providers themselves, e.g. in Google's sender guidelines. The 10 DNS lookup limit and the one-SPF-record rule come from the SPF specification (RFC 7208), and the DMARC levels from the DMARC specification (RFC 7489). The SPF mistake example comes from an audit of our own domain, done with the same scanner we offer for free.

Guide · as of 09.2026 · sources in the text

Check your domain for free

The scan shows the state of SPF, DKIM and DMARC, the SSL certificate and the site's headers. Results in a few seconds, without registration.

Check your security →

Prefer us to set it up for you? Fill in the brief or write to kontakt@aimatic.works

← All posts