Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
Email delivery

A queued Laravel mail fails with User unknown in virtual mailbox table

Your error

Recipient address rejected: User unknown in virtual mailbox table2 more lines it can show

Fix it fast

Most common cause, 1 of 3

The address has no mailbox on the server that hosts the domain

If the address is wrong, correct it in your users table and send again.

Fix
php artisan queue:failed
php artisan queue:retry <job-id>
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

Recipient address rejected: User unknown in virtual mailbox table is a 550 from Postfix. The recipient's domain is in virtual_mailbox_domains on the SMTP server Laravel uses, but virtual_mailbox_maps has no entry for that address. Correct the address, add the mailbox and rerun postmap, or drop the domain when its mail lives elsewhere. Postfix 3.8 to 3.11.

  • Applies to Postfix 3.11.7 stable and 3.8.6 (Ubuntu 24.04), Laravel 13.43 with Symfony Mailer 7.4 or 8.1
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

Log in to the server that MAIL_HOST in your .env points to. Ask Postfix which domains it treats as its own virtual mailbox domains, then look up where the recipient's domain really receives mail. Domain listed and MX points here: cause 1 or 3. Domain listed but MX points to another provider: cause 2.

Run this first
postconf virtual_mailbox_domains virtual_mailbox_maps
dig +short MX example.com

Then find the line you see in this list and open its fix:

  1. 1The address has no mailbox on the server that hosts the domainThe domain's MX is this server and other addresses at the same domain receive mail fine
  2. 2The server lists a domain whose mailboxes now live at another providerpostconf shows the recipient's domain in virtual_mailbox_domains, while dig shows MX hosts of Google Workspace, Microsoft 365 or another mail service
  3. 3The mailbox was added, but the lookup table was not rebuiltgrep finds the address in the source file, but postmap -q on the same table prints nothing

What does the error look like?

  • Recipient address rejected: User unknown in virtual mailbox table
  • Expected response code "250/251/252" but got code "550"
  • The queued notification lands in failed_jobs and every retry fails the same way

Cause 1 of 3

The address has no mailbox on the server that hosts the domain

You seeThe domain's MX is this server and other addresses at the same domain receive mail fine

Check

Postfix answers User unknown in virtual mailbox table when the domain is in virtual_mailbox_domains and the lookup for the exact address finds nothing. Often the user typed the address wrong at sign-up, or the mailbox was deleted after the account was created. Query the table with the address from the failed job.

Check
postconf -h virtual_mailbox_maps
postmap -q user@example.com lmdb:/etc/postfix/vmailbox

Fix

If the address is wrong, correct it in your users table and send again. If it should exist, create the mailbox. A 550 is a permanent reply, so retrying the same job without a change only fails again.

Fix
php artisan queue:failed
php artisan queue:retry <job-id>

Verify

The postmap query prints a mailbox path for the address, and the retried job no longer shows in queue:failed.

Verify
php artisan queue:failed

Confirmed by postfix.org

Did this fix it?

Cause 2 of 3

The server lists a domain whose mailboxes now live at another provider

You seepostconf shows the recipient's domain in virtual_mailbox_domains, while dig shows MX hosts of Google Workspace, Microsoft 365 or another mail service

Check

A domain listed in virtual_mailbox_domains is a final destination for that Postfix server, so it never looks up the MX. Every address that is not in its own map gets the User unknown reply, even when the real mailbox exists elsewhere. This is common after moving a company's mail to a new provider while the web server keeps the old setup.

Check
postconf -n virtual_mailbox_domains

Fix

Remove the domain from virtual_mailbox_domains (or from the database table that setting reads), then reload Postfix. The domain then falls into the default class, and mail for it from your logged-in app goes out through the smtp transport to its MX.

Fix
sudo cp /etc/postfix/main.cf /etc/postfix/main.cf.bak
sudo nano /etc/postfix/main.cf   # drop the domain from virtual_mailbox_domains
sudo postfix reload

Verify

postconf no longer prints the domain, and a retried Laravel job is accepted with a 250 reply.

Verify
postconf -h virtual_mailbox_domains

Confirmed by postfix.org

Did this fix it?

Cause 3 of 3

The mailbox was added, but the lookup table was not rebuilt

You seegrep finds the address in the source file, but postmap -q on the same table prints nothing

Check

Postfix reads the indexed lookup file, not the text file you edit. When a new line goes into /etc/postfix/vmailbox and postmap is not run, the indexed copy stays old and the new address is still unknown. For MySQL, PostgreSQL or LDAP maps, a query that returns no row has the same effect.

Check
grep -n "user@example.com" /etc/postfix/vmailbox
postmap -q user@example.com lmdb:/etc/postfix/vmailbox

Fix

Rebuild the table after every edit. Use the same type prefix the virtual_mailbox_maps setting shows; lmdb is used here, older setups may show hash or cdb. Reload Postfix after a main.cf change.

Fix
sudo postmap lmdb:/etc/postfix/vmailbox
sudo postfix reload

Verify

postmap -q now prints the mailbox path, and new mail for the address is accepted.

Verify
postmap -q user@example.com lmdb:/etc/postfix/vmailbox

Confirmed by postfix.org

Did this fix it?

How do I stop it coming back?

  • Keep a domain in only one Postfix address class, and take it out of virtual_mailbox_domains on the same day its MX moves to another provider.
  • Run postmap in the same script or deploy step that writes the mailbox file, never by hand afterwards.
  • Confirm email addresses at sign-up with a verification link, so typo addresses never reach the notification queue.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine on the same stack: Spotless Laundry, EZ Estimater.

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.