JSFiddle - React, Tailwind, and code Playground
HTML
The code in the JS window is actually BASH Script.
Purpose:
Verify whether an email domain is real or not by checking for an MX record.
Prerequisites:
none
Location:
/usr/local/bin/mx/mx.sh
To make it system-wide:
sudo ln -s /usr/local/bin/mx/mx.sh /usr/local/bin/mx
Remember to make script Executeable
sudo chmod +x /usr/local/bin/mx/mx.sh
To run command, enter:
mx
JavaScript
#! /bin/bash
LBLUE='\033[1;35m' # Set the colour (or use one in the list below by replacing the `1;35`)
echo -e "${LBLUE} Enter mail domain and press [ENTER]:\e[0m" # User-friendly request for input
read MAIL # Wait for input and Assign input to Variable `MAIL`
echo $MAIL >> /usr/local/bin/mx/mx.log # Keep a log file recording all queries
host -t mx $MAIL # Output the query
exit 0
# Blue 0;34
# Green 0;32
# Cyan 0;36
# Red 0;31
# Purple 0;35
# Brown 0;33
# Light Gray 0;37
# White 1;37
# Dark Gray 1;30
# Light Blue 1;34
# Light Green 1;32
# Light Cyan 1;36
# Light Red 1;31
# Yellow 1;33