In order to block certain words in Subject using postfix the following has to be done.
1. In /etc/postfix/main.cf add the following
vi /etc/postfix/main.cf header_checks = regexp:/etc/postfix/header_checks
2. Create header_checks and add the following line. In this example we will block XXX word separated by spaces.
vi /etc/postfix/header_checks /^Subject:.*\b(XXX)\b/ DISCARD