List of 1250+ email addresses reserved for security concerns
Table of Contents
npm install reserved-email-addresses-list validator nodemailer
yarn add reserved-email-addresses-list email-addresses
The string you are comparing with must be converted to lowercase and trimmed of whitespace. The reason we are converting to lowercase is because the dictionary of words we are comparing with are all lowercase, and in order to compare for strict equality, we must have matching case.
It is also highly recommended that you check for strict equality, and for a list of admin-related usernames, you should check for strict equality, starts with, or ends with comparisons as well.
const reservedEmailAddressesList = ;const reservedAdminList = ;const emailAddresses = ;const email = '"Admin***!!!"@example.com';const parsed = emailAddresses;if parsed === nullthrow 'Email was not a valid address';const str = parsedlocal;let reservedMatch = reservedEmailAddressesList;if !reservedMatchreservedMatch = reservedAdminList;if reservedMatchthrow'User must be a domain admin to create an alias with a reserved word (see ).';