Adding some tests for MailerFactory to ensure it works as expected with a provided configuration. Hopefully will help in debugging #523