Hi,
For the incoming mail it can be easily done using a procmail receipt, but for outgoing it's a bit tricky.
You can use amavis that by default discards attachments with certain extensions (.exe being one of them). To see how you can implement amavis with sendmail to do what you want, take a look at
this howto.
Don't forget to make backups before editing any configuration files
Regards