Some changes to mail scripts