Strongly inspired by comment at https://github.com/inverse-inc/sogo/pull/201#discussion-diff-54879796