WooCommerce + Amazon FBA: The E-Commerce Power Duo You Need.
Running an online store is exciting—until you’re buried under boxes, shipping labels,…
When you have a Plesk server managing hosting and DNS for a domain, but email is hosted on an external service (such as Office 365, Google Workspace, etc.), you may encounter this error when trying to send emails from other domains on the same server:
User unknown in virtual alias tabledomain.comdomain.comdomain.comPostfix (Plesk’s mail server) considers that if a domain is hosted on the server (even if only for hosting/DNS), it should deliver mail locally. This happens because:
/var/spool/postfix/plesk/virtual)virtual_alias_domains before transport_mapspostmap -q yourdomain.com hash:/var/spool/postfix/plesk/virtualIf it returns something (like “1”), the domain is registered as a local virtual domain.
postconf virtual_alias_domainsIf it shows virtual_alias_domains = $virtual_alias_maps, that’s the problem.
dig yourdomain.com MX +shortShould display external mail servers (e.g., yourdomain-com.mail.protection.outlook.com)
Add the domain to the transport file to force external delivery:
echo "yourdomain.com smtp:" >> /var/spool/postfix/plesk/transport
postmap /var/spool/postfix/plesk/transportEdit Postfix’s main configuration:
vi /etc/postfix/main.cfFind the virtual configurations section (near these lines):
virtual_mailbox_domains = $virtual_mailbox_maps, hash:/var/spool/postfix/plesk/virtual_domains
virtual_alias_maps = $virtual_maps, hash:/var/spool/postfix/plesk/virtual
virtual_mailbox_maps = , hash:/var/spool/postfix/plesk/vmailboxAdd this line right after:
virtual_alias_domains =Important: Leave it empty (no value after the =). This disables the default behavior where Postfix treats all domains in virtual_alias_maps as local.
# Verify the new configuration
postconf virtual_alias_domains
# Should display:
# virtual_alias_domains =
# Verify that transport is active
postmap -q yourdomain.com hash:/var/spool/postfix/plesk/transport
# Should return:
# smtp:
# Reload Postfix
postfix reloadTry sending an email from any domain on the server to the domain with external mail. It should work correctly now.
If the domain (e.g., merakia.es) is used as a master DNS server with subdomains like ns1.merakia.es and ns2.merakia.es, do NOT try to remove it from Plesk tables. The virtual_alias_domains = solution is correct in this case.
Add each domain to the transport file:
echo "domain1.com smtp:" >> /var/spool/postfix/plesk/transport
echo "domain2.com smtp:" >> /var/spool/postfix/plesk/transport
echo "domain3.com smtp:" >> /var/spool/postfix/plesk/transport
postmap /var/spool/postfix/plesk/transport
postfix reloadIf subdomains like subdomain.yourdomain.com also use external mail, add them to transport as well:
echo "subdomain.yourdomain.com smtp:" >> /var/spool/postfix/plesk/transport
postmap /var/spool/postfix/plesk/transportAfter applying the changes, send a test email and check the logs:
tail -f /var/log/maillogYou should see something like:
postfix/smtp[12345]: Connecting to yourdomain-com.mail.protection.outlook.com[X.X.X.X]:25
postfix/smtp[12345]: 1234ABCD: to=<user@yourdomain.com>, relay=yourdomain-com.mail.protection.outlook.com[X.X.X.X]:25, status=sentThis confirms that Postfix is delivering mail to external servers correctly.
This is normal and not a problem. What’s important is that virtual_alias_domains = is empty, which makes Postfix ignore those tables for routing.
Check the mail queue:
mailqIf there are stuck emails, verify:
telnet yourdomain-com.mail.protection.outlook.com 25If you receive this error, verify that relay_domains is correctly configured:
postconf relay_domainsIt should be empty or not include the problematic domain.
The key is in two fundamental configurations:
echo "yourdomain.com smtp:" >> /var/spool/postfix/plesk/transport
postmap /var/spool/postfix/plesk/transport# In /etc/postfix/main.cf
virtual_alias_domains =With these two configurations, Postfix will stop attempting local delivery and will correctly query external MX records.
Your configuration should look like this:
# Virtual domain configuration
virtual_mailbox_domains = $virtual_mailbox_maps, hash:/var/spool/postfix/plesk/virtual_domains
virtual_alias_maps = $virtual_maps, hash:/var/spool/postfix/plesk/virtual
virtual_mailbox_maps = , hash:/var/spool/postfix/plesk/vmailbox
virtual_alias_domains =
# Transport maps for external domains
transport_maps = hash:/var/spool/postfix/plesk/transportmain.cf before modifying itApplicable to: Plesk Obsidian, Postfix 3.x
En Carlos Herrera somos expertos en Diseño Gráfico, Marketing Digital y programación. Si estás pensando en actualizar tu marca, necesitas desarrollar tu imagen corporativa o tu web somos lo que buscas. Nos encontramos en Santander, Cantabria pero trabajamos para clientes de todo el mundo. Contacta con nosotros, estaremos encantados de asesorarte.

Optimiza tu web con nuestro servicio de mantenimiento especializado. Deja de preocuparte por caídas, errores y malfuncionamientos.