Silently drop emails to specific invalid domain in Postfix?

Solution 1:

First, you'll need to accept mail for the nonexistent domain, e.g. by adding it to virtual_mailbox_domains.

Then you'll need to make a catchall address in virtual_mailbox_maps that delivers it locally, for example:    throwaway

Last you need to make a local alias for throwaway in /etc/aliases that delivers mail to /dev/null, e.g.:

throwaway       /dev/null

Postmap and reload postfix as appropriate.

Solution 2:

To silently drop outgoing email, you can also use transport map file

transport_maps = hash:/etc/postfix/transport_maps

containing entries like :

[email protected] discard: discard: