I have tried the sample project basic/mail with my gmail account via imaps. I just changedtoCode:
And it seems to me that the attribute should-mark-messages-as-read has no effect, it is always true. Respectively messages are always marked as read on the gmail server.
I am using spring integration 2.0.0.RELEASE