2012年3月7日 星期三

Telnet SMTP bash script


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
You use netcat for this, not telnet.

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

沒有留言:

VMware VCenter 6.7設定Log Server失敗

VMware VCenter 6.7設定Log Server失敗 使用vCenter 6.7 設定步驟 開啟 VAMI 介面:開啟瀏覽器,輸入 https://<您的vCenter_IP>:5480。  登入:使用 root 帳號及其密碼登入。  進入 Syslog:...