Created
September 5, 2019 16:25
-
-
Save pl12133/ed3be8538dc0bbbc8b24bceaa6efdf31 to your computer and use it in GitHub Desktop.
Send an EML file through raw SMTP using Netcat
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
##### | |
# File: send-eml.sh | |
# Author: pl12133 | |
# Description: Send an eml file through an SMTP service using netcat | |
# Usage: ./send-eml.sh [file] [smtp-server] | |
##### | |
set -e | |
# like `cat`, but it waits for a reply. | |
function slowcat(){ cat "$@" | while read; do sleep 0.5; echo "$REPLY"; done; } | |
# $1 = filename of .eml file to send | |
# $2 = SMTP server to direct the message to | |
slowcat <(echo "HELO $2") "$1" <(echo "QUIT") | nc "$2" 25 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment