Fix Postfix “status=bounced (unknown user)” When Sending Mail to Your Own Domain

A minimalist flat vector illustration of a green email envelope icon with a bright amber gear wheel, symbolizing fixing a mail server configuration.

Mail to your own domain bounces with status=bounced (unknown user), even though the address looks valid. The underlying log line is a NOQUEUE: reject ... User unknown in local recipient table at SMTP time. This DevAnswers fix guide reads that log entry, then walks three fix paths: the domain belongs elsewhere, the user needs an alias, or the domain forwards. Verified on Ubuntu 22.04 / 24.04 / 26.04 and Debian 12 / 13 with stock Postfix 3.x.

What This Bounce Actually Means 

Postfix prints status=bounced (unknown user) in the mail log when two things are true at the same time:

  • The recipient domain (the part after the @) is listed in the mydestination parameter of /etc/postfix/main.cf, so Postfix considers the domain to be served locally on this machine.
  • The recipient username (the part before the @) is not found in the lookup tables that local_recipient_maps points at (by default, /etc/passwd via proxy:unix:passwd.byname plus /etc/aliases).

Postfix rejects the message at the SMTP server stage before it enters the queue. Per the Postfix Local Recipient README, this is intentional: “with the default Postfix configuration, the smtpd(8) server rejects mail for unknown local recipients with ‘User unknown in local recipient table’.” The benefit is no backscatter spam and no MAILER-DAEMON messages clogging the queue.

This is the same root cause whether you saw the bounce in a delivery notification, in journalctl -u postfix, or via a remote sender getting a 550 reply. It is a separate bounce class from the 5.7.26 SPF/DKIM bounce when sending to Gmail, which is about outbound sender authentication, not local recipient lookup.

Diagnose: Read the Bounce Log Entry 

Postfix logs go to two possible places depending on your distro:

  • Ubuntu 24.04+ and Debian 12+ use systemd-journald by default. Tail with sudo journalctl -u postfix -f (or omit -f to read past lines).
  • Ubuntu 22.04 and any system with rsyslog installed also write to /var/log/mail.log. Tail with sudo tail -f /var/log/mail.log.

Find the log line containing the bounced address. The line you want looks like this:

Postfix log line (NOQUEUE reject)
May 18 09:14:22 mail postfix/smtpd[12345]: NOQUEUE: reject: RCPT from external.example.com[203.0.113.42]: 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown in local recipient table; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<external.example.com>

The key phrase is User unknown in local recipient table. Note the recipient domain (here, example.com) and the username (here, missing); both matter for the fix.

Confirm the recipient domain is listed in mydestination:

Terminal
sudo postconf mydestination

If the bounced domain appears in the output, you have confirmed the local-recipient-table rejection path. Also check what local_recipient_maps is pointing at:

Terminal
sudo postconf local_recipient_maps

The Debian/Ubuntu default is local_recipient_maps = proxy:unix:passwd.byname $alias_maps: Postfix accepts mail for any system user plus anyone listed in /etc/aliases.

Decide Which Fix You Need 

What you do about the bounce depends on what the recipient domain is supposed to do on this mail server. Three common scenarios cover almost every reader who lands on this error:

If your domain…Typical reader scenarioUse
Shouldn’t be hosted here at allPostfix is an outbound relay (it sends but doesn’t receive for this domain), or the domain belongs on another server; it ended up in mydestination by mistake.→ Fix A
IS local, but the user doesn’t exist as a system accountYou want [email protected] to land in an existing user’s mailbox (or be forwarded to a Gmail address); the recipient is missing from /etc/passwd.→ Fix B
Is purely forwarding-only (every address maps elsewhere)Multi-domain mail-server pattern: you host several domains, each one forwards every address to one external inbox (Gmail, Fastmail, etc.). No real mailboxes exist on the server for that domain.→ Fix C

Per the Postfix Virtual README, a domain that is in virtual_alias_domains must not also appear in mydestination; the two are mutually exclusive. Fix A and Fix C both remove the domain from mydestination; Fix B keeps it there and changes the lookup tables instead.

Fix A: Remove the Domain from mydestination 

Edit /etc/postfix/main.cf and look at the mydestination line. The default on a fresh Ubuntu/Debian install includes the machine’s own hostname, localhost variants, and (after manual edits) any extra domains the operator added:

/etc/postfix/main.cf (before)
mydestination = $myhostname, mail.example.com, example.com, localhost.localdomain, localhost

Save and exit (press CTRL + X, press Y, then press ENTER)

Do not use sudo postconf -e 'mydestination = ...' for this change. postconf -e overwrites the whole parameter, so pasting an example value would wipe out any other domains in your real mydestination. Edit main.cf directly so you can see and preserve your existing values.

Open the file in your editor:

Terminal
sudo nano /etc/postfix/main.cf

Find the mydestination line and delete the domain that should not be served locally (in our example, example.com). Keep the other entries exactly as they were:

/etc/postfix/main.cf (after)
mydestination = $myhostname, mail.example.com, localhost.localdomain, localhost

Save and exit (press CTRL + X, press Y, then press ENTER)

Save and exit (in nano, that is Ctrl+O then Ctrl+X). Reload Postfix so the new main.cf takes effect. postfix reload is the right command for parameter changes; the master process re-reads the configuration without dropping in-flight deliveries:

Terminal
sudo postfix reload

Fix B: Add an Alias for the Missing User 

When the domain genuinely is local but the username does not exist as a system account, add an alias to /etc/aliases that maps the missing name to an existing destination. Edit the file:

Terminal
sudo nano /etc/aliases

Add the mapping. The left side is the missing username; the right side can be another system user, an external email address, or a comma-separated list of both:

/etc/aliases (additions)
info: admin
support: admin, [email protected]
billing: [email protected]

Save and exit (press CTRL + X, press Y, then press ENTER)

After editing, rebuild the alias database so Postfix can read it, then reload:

Terminal
sudo newaliases
sudo postfix reload

Fix C: Forward-Only Domain via virtual_alias_domains 

The most common multi-domain mail-server pattern: one machine receives mail for several domains, but each address simply forwards to an inbox somewhere else. There are no real mailboxes on the server for those domains. The Postfix-correct way to set this up is virtual_alias_domains plus virtual_alias_maps, not mydestination.

As with Fix A, do not use postconf -e for this change. It would overwrite your real mydestination with the placeholder values shown below. Edit main.cf by hand so you can see and preserve your existing settings.

First, remove the forwarding-only domain from mydestination and add it to virtual_alias_domains, then point virtual_alias_maps at a file you can edit. Open main.cf:

Terminal
sudo nano /etc/postfix/main.cf

Locate the mydestination line and remove the forwarding-only domain (in our example, example.com). Then add or update virtual_alias_domains and virtual_alias_maps. The relevant lines should end up looking like this (substitute your actual domain in virtual_alias_domains):

/etc/postfix/main.cf (relevant lines, after)
mydestination = $myhostname, mail.example.com, localhost.localdomain, localhost
virtual_alias_domains = example.com
virtual_alias_maps = hash:/etc/postfix/virtual

Save and exit (press CTRL + X, press Y, then press ENTER)

Save and exit. If you host more than one forwarding-only domain, list them comma-separated under virtual_alias_domains (e.g. example.com, anotherdomain.net).

Create or edit /etc/postfix/virtual with one line per forwarded address. The left side is the address as it arrives; the right side is where to forward:

Save and exit (press CTRL + X, press Y, then press ENTER)

The first three lines forward specific addresses at example.com (including the [email protected] that was bouncing in our running example). The last line is a catch-all: any address at anotherdomain.net forwards to [email protected]. Rebuild the hash map and reload Postfix:

Terminal
sudo postmap /etc/postfix/virtual
sudo postfix reload

Verify the Fix 

Open a second terminal on the Postfix server and start tailing the log (use the journalctl form on Ubuntu 24.04+ / Debian 12+; use the tail form if your system has rsyslog installed and writes /var/log/mail.log):

Terminal
sudo journalctl -u postfix -f

Then, in the first terminal (still on the Postfix server itself, so the message is handed to local Postfix rather than your workstation’s MTA), submit a test message. Replace [email protected] with the address that was previously bouncing:

Terminal
echo "Test after the fix" | /usr/sbin/sendmail [email protected]

A clean fix produces a status=sent entry (instead of the previous NOQUEUE: reject line). For Fix C, the same log line also shows orig_to=<[email protected]>, confirming Postfix expanded the virtual alias to the forwarding target.

For Fix B specifically, the destination user receives the alias-routed message in their local mailbox; see our companion guide on reading local mail on Linux if you are checking the alias landed correctly.

Next Steps 

If your Postfix server still struggles with deliverability to mainstream providers after this fix, the practical alternative is to route outbound mail through a hosted SMTP service rather than try to maintain your own sender reputation. Our guide on configuring Postfix to relay through an external SMTP server covers the Mailgun and SendGrid setup paths.

For PHP application mail running through this same Postfix install, see the companion guide on configuring PHP’s mail() function to use local Postfix. If your bounce is actually the 550-5.7.26 SPF/DKIM authentication error from Gmail (which is a separate root cause from the local-recipient bounce covered here), the fix is in fixing the 550-5.7.26 Gmail SPF/DKIM bounce.

Support DevAnswers
Written, tested and maintained by one developer. Your support keeps these guides accurate and ad-light.
Buy me a coffee

14 replies

Leave a reply

  1. Phyllo

    Thanks, this seems to have worked for me partially. Microsoft 365 shows it as a junk e-mail, but it least got sent which is better than not sending at all!

  2. Gerhard

    It works!!! The simplest solution is always the best.

  3. nomeer

    it doesn’t work for me 🙁

  4. jusdepixel

    Thanks !!!

  5. Borislav Jordanov

    Thanks for making it simple! I went through very complicated configurations and couldn’t see what was wrong with mine until I saw this one.

  6. Thomas | Code Sheep

    Dude, you are awesome. Your articles have saved my butt more than a few times, thanks!!

    1. DevAnswers

      😎👍🏻

  7. Jakke Lehtonen

    If I’m right this happends only when hostname is same as domain. And it should not be because then FQDN breaks. So, if your domain is example.com and you want get something informatic in the beginning of SSH-commandline you should use somethinglike example as hostname.

  8. ax9g9n

    Works like a charm, thanks a lot .

  9. Crealogic

    Quick, accurate, simply great. Thank you very much.

  10. Kamrul Ahsan

    Thanks man. Works great

  11. DH

    Like every other suggestion I can find. it doesnt work. The only way I can find to send to my own domain or relay to my own domain is to change the domain name in the hosts file. Then everything works

  12. Rahul Bhayana

    HI! It didn’t work for me. But I have a question, what happens if I keep mydestination header blank ?

  13. Tim

    Thanks a lot. Easy to understand, saved a lot time.