fix build.xml and mail logic