Route email destined for a selected domain to /dev/null
I wanted to do some testing with some forms on my web site, but I did not want to deal with the resultant output going to email.
I added the following line to the /etc/postfix/transport file
fubar.com discard
Then I added the following line to the /etc/postfix/main.cf file
transport_maps = hash:/etc/postfix/transport
Then I executed
postmap /etc/postfix/transport
systemctl restart postfix
Any email destined to (anybody)@fubar.com gets sent straight to the bit bucket.
Tested on Centos 7