What the message looks like
postfix/smtpd[3105]: NOQUEUE: reject: RCPT from unknown[203.0.113.30]: 450 4.1.8 <root@server1.localdomain>: Sender address rejected: Domain not found; from=<root@server1.localdomain> to=<admin@example.com> proto=ESMTPCommon causes
- The sender address uses a made-up domain such as
.localor.localdomain, often from cron or monitoring mail. - The sender domain really has no A or MX record, because of a typo or a domain not yet set up.
- The DNS of the receiving server is broken or slow, so a good domain looks missing. The 4xx code means a temporary refusal.
- A new or moved domain whose DNS has not propagated or was deleted by mistake.
Check
- Does the sender domain have an MX record?
- Does it have an A record?
dig +short A example.com - What is the DNS status for the domain?
dig example.com MX | grep -E 'status:' - Which sender checks are active?
postconf -n | grep -E 'smtpd_sender_restrictions|unknown_address_reject_code|myorigin'
Fix
- If the domain is fake, change the sender. For your own server, set a real domain:
myorigin = example.cominmain.cf, or rewrite the sender withsender_canonical_maps. - For apps and cron, set the From address in their own settings to a real address in a domain that has DNS records.
- Fix missing DNS: publish an A or MX record for the sender domain, and check the zone for typos.
- If your own resolver is the problem, test it with
dig example.com MX @1.1.1.1and repair/etc/resolv.confor the local resolver. - Only as a last resort, remove
reject_unknown_sender_domainfromsmtpd_sender_restrictions. That check blocks a lot of junk.
Typical scenario
A web shop sends order confirmations with the sender shop@server01.company.local. Receivers with strict checks refuse with 450 4.1.8 Sender address rejected: Domain not found, and the messages stay in the queue. The .local domain does not exist in public DNS. First check which sender address is actually used in the envelope, with postqueue -p and in the header, not just what the mail client displays.
FAQ
Why is it a 450 and not a 550?
Postfix uses unknown_address_reject_code, which defaults to 450 (try again). Senders retry, so a short DNS problem does not lose mail. Set it to 550 only if you want a hard refusal.
Will the mail still arrive?
A sending server keeps retrying for days. If the sender domain is fake, it will never succeed, so fix the address at the source.
Is an MX or an A record enough?
An MX record or, as a fallback, an A record satisfies the reject_unknown_sender_domain check. Even a domain that never receives mail itself should have a record if mail is sent from it. If the zone is missing altogether, the rejection stays.
Why does it not work right after the fix?
Receiving servers remember negative DNS answers for a limited time, depending on the zone's SOA value. Right after creating the record the old rejection can therefore still occur. The queue delivers on its own at the next attempt.
How do I replace an internal sender domain?
Rewrite the sender in Postfix, for example with sender_canonical_maps, and set myorigin to a real domain. Then a resolvable address goes out. You do not have to change the application itself. Apply it with postfix reload.