How to terminate SMTP session within a shell script?

From: Jarzombek, Svend (Svend.Jarzombek@ALCOA.COM)
Date: Tue Jan 20 2004 - 10:45:08 EST


The skeleton of a SMTP shell script below worked fine until last Friday.

#######################################
(sleep 5
echo HELO test.com ### added today
sleep 5 ### added today
echo MAIL FROM: SCRIPT@test
sleep 5
echo RCPT TO: svend.jarzombek@alcoa.com
sleep 5
echo DATA
sleep 5
echo Date: Di 20 Jan 15:19:38 2004
echo From: SCRIPT@test
echo Subject: SMTP script test
echo
echo ""
echo "SMTP script test"
echo ""
echo
echo .
echo
echo QUIT
sleep 5) | telnet aaa.bbb.ccc.ddd 25
#######################################

Then the company mail server / mail server software has been changed
without notice, so that mails triggered by scripts have not been
delivered.

After retrieving the IP address of the new SMTP server I opened up a
transmission channel manually and figured out that I had to add the
"echo HELO test.com" line to the SMTP script.

Now mails are delivered as before, but the transmission channel is not
terminated after delivery of the mail. The transmission channel
connection times out after a certain period of time.

If I run the above script from the command line, the final SMTP server
reply is:
"354 Start mail input; end with <CRLF>.<CRLF>"

Does anybody know how to camouflage <CRLF>.<CRLF> within the SMTP script
to close the transmission channel all at once.

TIA

Svend



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:31 EDT