SMTP via Telnet scripten

#!/bin/sh	
( sleep 2
  echo helo server2
  sleep 2
  echo mail from: thomas@tbarth.info
  sleep 2
  echo rcpt to: thomas@tbarth.info
  sleep 2
  echo data
  sleep 2
  echo Subject: Test per SMTP
  sleep 1
  echo ""
  sleep 1
  echo Dies ist der Body
  sleep 1
  echo ""
  sleep 1
  echo "."
  sleep 3
  echo logout ) | telnet server2 25


Dies sollte folgenden Output erzeugen:

server2:~ # ( sleep 2
> echo helo server2
> sleep 2
> echo mail from: thomas@tbarth.info
> sleep 2
> echo rcpt to: thomas@tbarth.info
> sleep 2
> echo data
> sleep 2
> echo Subject: Test per SMTP
> sleep 1
> echo ""
> sleep 1
> echo Dies ist der Body
> sleep 1
> echo ""
> sleep 1
> echo "."
> sleep 3
> echo logout ) | telnet server2 25
Trying 192.168.10.3...
Connected to server2.
Escape character is '^]'.
220 server2.home ESMTP Postfix
250 server2.home
250 Ok
250 Ok
354 End data with <CR><LF>.<CR><LF>
250 Ok: queued as 0945211F784
Connection closed by foreign host.
server2:~ #
linux/network/smtp-telnet.txt · Last modified: 2009/12/04 15:23 by tbarth
 
Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki