Created
April 26, 2016 10:17
-
-
Save larsar/9787432ffbc01803d2418a8d4c822f2e to your computer and use it in GitHub Desktop.
Check user authentication with SMTP
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
#!/usr/bin/env bash | |
[[ $@ ]] || { | |
printf "Usage\n\t./$0 server username password\n" | |
exit 1 | |
} | |
SERVER=$1 | |
MAILUSER=$2 | |
PASSWORD=$3 | |
AUTH_STRING=`echo -n -e "$MAILUSER\0$MAILUSER\0$PASSWORD" | openssl base64 -e` | |
{ | |
sleep 1 | |
echo "EHLO $HOSTNAME" | |
sleep 1 | |
echo "AUTH PLAIN $AUTH_STRING" | |
sleep 5 | |
echo "QUIT" | |
} | telnet $SERVER 587 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment