FIX: IMAP sync email update uniqueness across groups and minor improvements (PR #10332)

GitHub

The title of this pull request changed from “FIX: IMAP sync email update uniqueness across groups” to "FIX: IMAP sync email update uniqueness across groups and minor improvements