PDI-10909 - Email message input: retrive the first ... emails

Fix with junit tests.