I need a script (or scripts) that can be run from Mac OS X by command line. Choose whatever scripting language you prefer.
1. Read a text file (CSV) that contains a list of Internet domains.
2. Query the MX records for each Internet domain in the text file and export the servers for the Internet domains to a text file (CSV).
3. Read the CSV file generated by #2 and connect to each server via TCP port 25 and issue SMTP commands (EHLO) to determine if the server supports TLS (i.e. does the server offer STARTTLS). Export the SMTP banner and if STARTTLS is support to a text file (CSV).
The end result is a text file (CSV) that has the following columsn: Domain Name, Mail Server, SMTP Banner, EHLO Response, STARTTLS
The value for STARTTLS is Yes or No.