fixes NPE on missing attachment name
fixes NPE on missing FROM field and tests added