Skip to content

Instantly share code, notes, and snippets.

@DoctorD90
Created February 14, 2016 14:52
Show Gist options
  • Save DoctorD90/17c5805234e6317433fc to your computer and use it in GitHub Desktop.
Save DoctorD90/17c5805234e6317433fc to your computer and use it in GitHub Desktop.
Get Mailinator.com alive domains
#!/bin/bash
maxtest="200"
prefix="<span style=\"font-weight: bold;color:lightblue;font-size:24px;\">@"
suffix="</span>"
hostout="mail is handled by"
mydir="./domains"
mydomfile="$mydir/total.txt"
mydomgood="$mydir/good.txt"
mydombad="$mydir/bad.txt"
mkdir -p -v $mydir
if [ -e "$mydomfile" ]; then
mydomainl=$(cat "$mydomfile" | wc -l)
else
mydomainl="0"
fi
echo "Starting $maxtest mailinator's domains collection by $mydomainl"
for i in $(seq 1 "$maxtest"); do
echo -n "Step $i . . . "
#asd=$(curl -s http://mailinator.com)
asd=$(wget -qO- http://mailinator.com)
asd=$(echo "$asd" | grep -i "$prefix")
#echo "$asd" >> "$mydomfile"
asd=${asd#*"$prefix"}
asd=${asd%"$suffix"*}
echo "${asd}" >> "$mydomfile"
echo "${asd}"
done
qwe=$(cat "$mydomfile" | sort | uniq)
echo "$qwe" > "$mydomfile"
mydomainll=$(cat "$mydomfile" | wc -l)
rm -rf "$mydomgood" "$mydombad"
g=0
b=0
for mx in $qwe; do
echo -n ". "
mio="$(host -t mx $mx)"
#mailinator.com mail is handled by 10 mail.mailinator.com.
if [[ "$mio" == "$mx $hostout"* ]]; then
if [[ "$mio" == "$mx $hostout"*mail.mailinator.com* ]]; then
g=$((g + 1))
echo "$mx" >> "$mydomgood"
else
c="a"
while [ "$c" == "a" ]; do
echo ""
echo "CHECK: $mio"
echo -n "Good [1] or Bad [0] : "
read c
if [[ "$c" == "0" ]]; then
b=$((b + 1))
echo "$mx" >> "$mydombad"
elif [[ "$c" == "1" ]]; then
g=$((g + 1))
echo "$mx" >> "$mydomgood"
else
c="a"
fi
done
fi
else
b=$((b + 1))
echo "$mx" >> "$mydombad"
fi
done
echo "
### Summary ###
Total: $mydomainll
Old: $mydomainl
New: $((mydomainll - mydomainl))
Working: $g
Down: $b
### GOODS LIST ###"
cat "$mydomgood"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment