When we don't provide HeaderMapper to the ImapIdleChannelAdapter (for example), an internal transformation is applied to the MimeMessage - IntegrationMimeMessage.
With the HeaderMapper we end up with this results after target receiving:
POP3 works well. That's why I assume that we have something wrong in the ImapServer.doRun().
The simplest way to reproduce is ImapMailReceiverTests.testIdleWithMessageMapping() and additional asserts in the code block:
for expected FROM, TO and payload.