Telnet SMTP bash script
Code:
#!/bin/bash ( sleep 1 echo "ehlo x" sleep 1 echo "mail from:frommail" sleep 1 echo "rcpt to:tomail" sleep 1 echo "data" sleep 1 echo "subject:Test message" sleep 1 echo "from:frommail sleep 1 echo "to:tomail" sleep 1 echo " " #sleep 1 echo "Hello." sleep 1 echo "This is a test message." sleep 1 echo "Bye." sleep 1 echo "." sleep 1 echo "QUIT" ) | telnet 172.17.7.140 25
Code:
[xxx@xxx src]$ nc localhost 25 << EOF > HELO localhost > MAIL FROM: user@whatever.com > RCPT TO: user@whatever.com > DATA > this is a test > . > QUIT
沒有留言:
張貼留言