Merging some tests from mailer branch