Skip to Content.
Sympa Menu

baslinux - [BL] Fwd: sending mail via telnet

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: "David Moberg" <davidjmoberg AT gmail.com>
  • To: baslinux AT lists.ibiblio.org
  • Subject: [BL] Fwd: sending mail via telnet
  • Date: Sat, 2 Dec 2006 19:42:45 -0800

The following message was sent by Lee Forrest. I am forwarding it to
the list because the listserver is rejecting all posts by him. (Note
the To: line below)

---------- Forwarded message ----------
From: Lee Forrest <lforrestster AT gmail.com>
Date: Dec 2, 2006 3:44 PM
Subject: Re: sending mail via telnet
To: baslinux AT lists.ibiblio.org
Cc: davidjmoberg AT gmail.com


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