Option to restrict mail to be sent only for failed builds

In my company there are lots of instable tests and receive a lot of e-mails with build become unstable/build back to normal is very annoying.
This option restrict to only failed builds.