I am trying to set up KMail on Ubuntu 16.04 (not Kubuntu) and I am affected by this bug. The bug seems to have been resolved, but at the very end of the topic in the bugtracker one can read that the version containing the fix is akonadi 5.2, while the version installed via repo (as reported by akonadictl --version) is 5.1.51.
How can I install a newer version of akonadi containing the fix?