[WO-325] Added more tests for mailbuild

Some additional tests and test refactoring