Move common functions to mail.c