Validating e mail addresses
Email existed before DNS and before our modern email address format can be a local user account, role account, or routing address to an automated system, such as a mailing list.
Hostname is a computer identified through DNS used to receive the message.
In Perl, you can concoct a complicated regular expression, of course; or you turn to a handy module that already has one built in and can check domain names, too.
Whatever the reasons for its invalidity, you do want to catch the broken address — to prompt the user to re-enter maybe, or to avoid sending an email that's sure to go nowhere.
The tests are written for any Node JS testing library, but has been run and targeted at the https://mochajs.org/ testing library.