Make postfix reject unknown recipients

postfix

i'd like my postfix relay to reject mail for unknown recipients.

i have recipients listed in the transports file along with next hop information.

i have a catchall of "* smtp:next-hop-gateway:25".

is it enough to simply remove that line from the transports and reload?

my expectation is that this would cause postfix to reject anything not defined in the transports file.

is that correct?

thanks,

postfix user

Best Answer

The transport(5) file is not meant to hold valid recipients; in fact, it cannot.
Read its documentation to understand what it is for.

Catchalls are bad, don't use them. We will not support such mailserver abuse.

Please see here how to reject non-existing recipients

How exactly you should set this up depends on far too many factors to go into without significantly more information.