How to setup the email plugin in the dev environment to prevent sending real mails?

I would like to prevent sending “real” email, using the email plugin, while in development environment.

For now, I created a dummy local provider, with an empty send function. This provider is only used in development environment and mailgun is used in production.

Is there a more direct way to do it?