Linux – How to quicly set up postfix to accept all messages coming to its domains (even if there is no corresponding user mailbox for the recipient address)

emaillinuxpostfix

For example if I've got john.smith@example.com and ty.coon@example.com mailboxes set up, but someone sends message to thomas.anderson@example.com I need the message to be stored to a special mailbox and reported (to the sender) as delivered instead of being returned with user-unknown error and discarded.

Best Answer

Postfix supports the use of a catchall account using the luser_relay configuration option.

See http://www.postfix.org/ADDRESS_REWRITING_README.html#luser_relay for more information.

"When the local(8) delivery agent finds that a message recipient does not exist, the message is normally returned to the sender ("user unknown"). Sometimes it is desirable to forward mail for non-existing recipients to another machine. For this purpose you can specify an alternative destination with the luser_relay configuration parameter."