Update mailer.js

only send mail of the type declared in the config.mail.what array.