#!/bin/bash ## sillymail ## simple 'telnet' email client ## exercise in bash, except, smtp, ... ## # requires expect # # Koen Noens, november 2008 # This is free software under the terms and conditions of GPL v3 ## TODO : mechanism to take command line arguments # param SERVER="$1" PORT=25 RELAY="$SERVER $PORT" BODY=$(mktemp) ## User Interface echo; echo -n "HELO: "; read HELO; echo -n "mail from: "; read FROM; echo -n "mail to: "; read TO; echo -n "subject: "; read SUBJ; if [ "$SERVER" = "" ]; then echo -n "mail server: " ; read SERVER fi usage (){ echo; echo "$0 server" echo "where server is the fqdn of a mail server" } ## write mail echo "write message. Ctrl+D when Done"; echo (cat > $BODY) ## do protocol with expect expect <