Skip to Content.
Sympa Menu

baslinux - Re: [BL] sending mail via telnet

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: Lee Forrest <lforrestster AT gmail.com>
  • To: baslinux AT lists.ibiblio.org
  • Cc: davidjmoberg AT gmail.com
  • Subject: Re: [BL] sending mail via telnet
  • Date: Sat, 2 Dec 2006 15:44:05 -0800

On Sat, Dec 02, 2006 at 02:37:46PM +0000, sindi keesan wrote:

[delete]

> >For scripting, netcat is _much_ better than telnet. I have a toy
> >bash script that sends mail to a mailserver with netcat.
>
> Would you like to share this info with the list and also send a copy to
> David, and if it does not arrive he can forward it? BL has netcat. I
> think we use it to send files over serial or ethernet cable between
> computers, with a bash script that Steven wrote (send/receive).

##!/bin/bash
#
## this works - need to get DATA part in a file
## to read in.
#
#log=/dev/tty
#smtp_server=smtp.foo.net
#mkfifo /tmp/$$.out
#hostname=localhost
#
#function read_response () {
# local status=""
# while [ -z "$status" ] ; do
# read line < /tmp/$$.out
# case "$line" in
# [0-9]??' '*) status="$(echo "$line" | sed -e 's/^\(.\).*/\1/')" ;;
# [0-9]???*) true ;;
# *) echo QUIT ; sleep 3 ; exit 1 ;;
# esac
# done
# echo "$status"
#}
#
#
#(
# if [ $(read_response) != "2" ] ; then echo QUIT ; sleep 3 ; exit 1 ; fi
# echo "HELO $hostname"
# if [ $(read_response) != "2" ] ; then echo QUIT ; sleep 3 ; exit 1 ; fi
# echo "MAIL FROM: abc AT def.ghi"
# if [ $(read_response) != "2" ] ; then echo QUIT ; sleep 3 ; exit 1 ; fi
# echo "RCPT TO: alanconnor AT earthlink.net"
# if [ $(read_response) != "2" ] ; then echo QUIT ; sleep 3 ; exit 1 ; fi
# echo "DATA"
# if [ $(read_response) != "3" ] ; then echo QUIT ; sleep 3 ; exit 1 ; fi
# echo "Subject: FOOBAR"
# echo ""
# echo "KKKKKKKKKKKKKK"
# echo ""
# echo "."
# if [ $(read_response) != "2" ] ; then echo "QUIT"
# echo "Delivery Failed" > $log; sleep 3 ; exit 1 ; fi
#)| netcat $smtp_server 25 > /tmp/$$.out
#exit 0

[delete]

Lee






Archive powered by MHonArc 2.6.24.

Top of Page