How can I block outgoing mail for a specific user (user@example.com) in Postfix to all but a specific list of domains (e.g. @example.com, @dot1q.com)?
I found a solution to block mail to a specific domain:
Edit the main.cf file (the default location is in /etc/postfix) and add
transport_maps = hash:/etc/postfix/transport
to the file. Create a file named /etc/postfix/transport, if it doesn’t exist. Add the following at the end of the transport file:example.com : dot1q.com : * discard:
but this unfortunately blocks email for all users. Is it possible to make this work for only one user user@example.com?