Created
April 27, 2018 11:13
-
-
Save goffinet/670f1c2d256bd4bb50c76563e7787962 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # script to send test mail with netcat | |
| # http://nmap.org/dist/ncat-portable-5.59BETA1.zip | |
| # for nmap Windows binary | |
| base="mail.internetmail.be" | |
| belgacom="relay.skynet.be" | |
| billi="relay.billi.be" | |
| dommel="relay.dommel.be" | |
| edpNet="relay.edpnet.be" | |
| euphony="out.euphonynet.be" | |
| orange="smtp.mobistar.be" | |
| morange="gprsmail.mobistar.be" | |
| online="smtp.antw.online.be" | |
| mproximus="relay.proximus.be" | |
| scarlet="smtp.scarlet.be" | |
| mscarlet="mail.internetmail.be" | |
| tele2="out.tel2allin.be" | |
| telenet="uit.telenet.be" | |
| telesat="smtp.telesat.lu" | |
| tiscali="smtp.tiscali.be" | |
| versatel="out.versateladsl.be" | |
| voo="smtp.voo.be" | |
| xs4all="smtp.xs4all.be" | |
| belgiantelecom="smtp.bedsl.be" | |
| list=" | |
| mail.internetmail.be | |
| relay.skynet.be | |
| relay.billi.be | |
| relay.dommel.be | |
| relay.edpnet.be | |
| out.euphonynet.be | |
| smtp.mobistar.be | |
| gprsmail.mobistar.be | |
| smtp.antw.online.be | |
| relay.proximus.be | |
| smtp.scarlet.be | |
| mail.internetmail.be | |
| out.tel2allin.be | |
| uit.telenet.be | |
| smtp.telesat.lu | |
| smtp.tiscali.be | |
| out.versateladsl.be | |
| smtp.voo.be | |
| smtp.xs4all.be | |
| smtp.bedsl.be | |
| " | |
| # for mail_input function | |
| #from=$1 | |
| #to=$2 | |
| echo "SMTP Server List" | |
| echo "----------------" | |
| for x in $list ; do echo $x ; done | |
| read -p "Enter Recipient's Mail Server: " server | |
| read -p "Enter Your Email Address: " from | |
| read -p "Enter Recipient's Email Address: " to | |
| # check if proper arguments are supplied | |
| # Not in use | |
| function check_args { | |
| if [ $# -ne 4 ]; then | |
| echo -e "\n Usage error!" | |
| exit 1 | |
| fi | |
| } | |
| # error handling | |
| function err_exit { echo -e 1>&2; exit 1; } | |
| # create message | |
| function mail_input { | |
| # echo "ehlo $(hostname -f)" | |
| echo "EHLO 127.0.0.1" ; sleep 1 | |
| echo "MAIL FROM: <$from>" ; sleep 1 | |
| echo "RCPT TO: <$to>" ; sleep 1 | |
| echo "DATA" ; sleep 1 | |
| echo "From: $from" ; sleep 1 | |
| echo "To: $to" ; sleep 1 | |
| echo "Subject: Testing one two three" | |
| echo "This is only a test. Please do not panic. If this works, then all is well, else all is not well." ; sleep 1 | |
| echo "." ; sleep 1 | |
| echo "QUIT" | |
| } | |
| # Test | |
| mail_input | ncat $server 25 || err_exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment