Refactor out get_email_charset to leap.common
Merge remote-tracking branch 'chiiph/bug/refactor_mail_charset' into develop