2013年2月24日日曜日

expectでメールを送ってみる

こんな感じか?

#!/usr/bin/expect
set timeout 10
#spawn telnet localhost 587
spawn telnet localhost 25
expect "Debian"
send "HELO jitaku\n"
expect "250"
send "MAIL FROM: from@hoge.com\n"
expect "250"
send "RCPT TO: to@hoge.net\n"
expect "250"
send "DATA\n"
expect "354"
send "test mail!\n"
send ".\n"
expect "250"
send "QUIT\n"
interact
view raw mailtest hosted with ❤ by GitHub

0 件のコメント: