Modifications to mail functions.