mail loops back to myself | postfix

Solution 1:

This happens when domain.com has an MX record (or, in the absence of an MX, an A record) that points to your Postfix server, but your Postfix server is not configured to accept mail for that domain. It's commonly seen in two situations:

  1. You've acquired a new domain that you want to use for email, but you just forgot to add it to Postfix. There are a couple ways to do it. In my case, I'm using the virtual table to map addresses to real local users, so I list my domains in the virtual_alias_domains directive in main.cf.
  2. The domain has its MX record set to a host that resolves to 127.0.0.1. Some malware will use this trick so they can set their return address to a valid domain, which most anti-spam measures will check for. However, the MX effectively prevents any delivery to that address, so the sender doesn't have to deal with replies or bounces.

Solution 2:

Given that Postfix tries to deliver a mail to "[email protected]", the above error happens whenever the MX DNS records (or transport_maps entries) for "example.net" point to the server itself (or the one of the IP addresses specified with proxy_interfaces) , and "example.net" is not recognized as a local domain (not in mydestination, virtual_mailbox_domains or relay_domains - and some very esoteric special cases involving liberal use of virtual_alias_maps and IP literal addressing).

In your case, the message in question is sent from the null sender and the recipient will be the sender of the original mail. That means: Find out why mail for "domain.com" is routed to your Postfix server and why "domain.com" is not recognized as a local address.