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

沒有留言:

Excel 資料對照需求!我最推薦使用 XLOOKUP

這是一個非常經典的 Excel 資料對照需求!要達成這個目的,我最推薦使用 XLOOKUP (如果你使用的是較新版本的 Excel)或最傳統的 VLOOKUP 。 以下我為你整理了兩種最常用的方法: 方法一:首選推薦 XLOOKUP (適用於 Excel 365 / 2021 以...