VanGans

smtp command

Sep 17th, 2018
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.89 KB | None | 0 0
  1. #!/bin/bash
  2. #//Coded By VanGans
  3.  
  4. NC='\033[0m'
  5. GREEN='\e[38;5;82m'
  6. CYAN='\e[38;5;45m'
  7. RED='\e[38;5;196m'
  8. ##
  9. printf  "\e[38;5;82m  _____   __  __   _______   _____   \n"   
  10. printf  "\e[38;5;82m  / ____| |  \/  | |__   __| |  __ \  \n"  
  11. printf  "\e[38;5;82m | (___   | \  / |    | |    | |__) | \n"  
  12. printf  "\e[38;5;82m  \___ \  | |\/| |    | |    |  ___/  \n"  
  13. printf  "\e[38;5;82m   ___) | | |  | |    | |    | |      \n"  
  14. printf  "\e[38;5;82m |_____/  |_|  |_|    |_|    |_|      \n"      
  15. printf  "\e[38;5;82m                                                                     \n"
  16. printf  "\n"
  17. printf "${NC}\n"
  18. printf "${RED}${NC}\n\n"
  19. printf "\n";
  20. # mail.sh
  21. # echo "PUT YOUR MAIL BODY HERE" | mailx -s "We've blocked any access attempts to your account."
  22. #-S smtp-auth=login
  23. #-S smtp-auth-password=???
  24.  
  25. if [ $# -ne 7 ]
  26. then
  27. echo "Usage: $0 FromAdress ToAdress Domain MailServer MailTextFile AuthEmail AuthPass"
  28. stop 1
  29. fi
  30.  
  31. #  $authemail "mail smtp"
  32. $authemail=`echo $6|openssl enc -base64|awk 'sub("..$", "[email protected]")'`
  33. #  $authpass "mail password"
  34. $authpass=`echo $7|openssl enc -base64|awk 'sub("..$", "password")'`
  35.  
  36. if [ ! -f $mailtext ]
  37. then
  38. echo "Cannot find your mail text file. Exiting..."
  39. exit 1
  40. fi
  41.  
  42. exec 9<>/dev/tcp/$mailserver/25
  43. echo "HELO $domain" >&9
  44. read -r temp <&9
  45. echo "$temp"
  46. echo "auth login" >&9
  47. read -r temp <&9
  48. echo "$authemail" >&9
  49. read -r temp <&9
  50. echo "$authpass" >&9
  51. read -r temp <&9
  52. echo "Mail From: $from" >&9
  53. read -r temp <&9
  54. echo "$temp"
  55. echo "Rcpt To: $to" >&9
  56. read -r temp <&9
  57. echo "$temp"
  58. echo "Data" >&9
  59. read -r temp <&9
  60. echo "$temp"
  61. cat $mailtext >&9
  62. echo "." >&9
  63. read -r temp <&9
  64. echo "$temp"
  65. echo "quit" >&9
  66. read -r temp <&9
  67. echo "$temp"
  68. 9>&-
  69. 9<&-
  70. echo "All Done Sending Email. See above for errors"
  71. exit 0
Advertisement
Add Comment
Please, Sign In to add comment