This change should help you here:
https://github.com/MailCore/mailcore2/commit/a7039a0587d56e3984e29386e42e2bb51ecd465f