Fixed legacy email configuration code