<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: telnet port 25 script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674990#M917265</link>
    <description>Michael,&lt;BR /&gt;&lt;BR /&gt; Not 100% sure but try blank lines before &amp;amp; after the ".".&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Jeff</description>
    <pubDate>Sat, 02 Mar 2002 02:25:37 GMT</pubDate>
    <dc:creator>Jeff Schussele</dc:creator>
    <dc:date>2002-03-02T02:25:37Z</dc:date>
    <item>
      <title>telnet port 25 script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674989#M917264</link>
      <description>Hi anyone - I thought it would be easy to send a message from HP-UX 10.20 using the following script called "magic3":&lt;BR /&gt;&lt;BR /&gt;telnet 193.0.9.27 25 &amp;lt;</description>
      <pubDate>Sat, 02 Mar 2002 02:21:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674989#M917264</guid>
      <dc:creator>Michael Skora</dc:creator>
      <dc:date>2002-03-02T02:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: telnet port 25 script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674990#M917265</link>
      <description>Michael,&lt;BR /&gt;&lt;BR /&gt; Not 100% sure but try blank lines before &amp;amp; after the ".".&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Jeff</description>
      <pubDate>Sat, 02 Mar 2002 02:25:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674990#M917265</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2002-03-02T02:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: telnet port 25 script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674991#M917266</link>
      <description>If that doesn't work - try &lt;BR /&gt;\015\012  on lines before &amp;amp; after.&lt;BR /&gt;&lt;BR /&gt;Jeff</description>
      <pubDate>Sat, 02 Mar 2002 02:31:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674991#M917266</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2002-03-02T02:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: telnet port 25 script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674992#M917267</link>
      <description>Thanks Jeff, but no work.  In fact, with the extra blank lines, it now takes two Ctrl-C's to complete the script.</description>
      <pubDate>Sat, 02 Mar 2002 02:32:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674992#M917267</guid>
      <dc:creator>Michael Skora</dc:creator>
      <dc:date>2002-03-02T02:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: telnet port 25 script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674993#M917268</link>
      <description>Jeff - that didn't work either.  But when I Ctrl-C's, the message went through and was:&lt;BR /&gt;test&lt;BR /&gt;\015\012&lt;BR /&gt;</description>
      <pubDate>Sat, 02 Mar 2002 02:34:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674993#M917268</guid>
      <dc:creator>Michael Skora</dc:creator>
      <dc:date>2002-03-02T02:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: telnet port 25 script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674994#M917269</link>
      <description>Ok - is the mail server local ie the same system you run this script on?&lt;BR /&gt;&lt;BR /&gt;Jeff</description>
      <pubDate>Sat, 02 Mar 2002 02:41:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674994#M917269</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2002-03-02T02:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: telnet port 25 script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674995#M917270</link>
      <description>Well, the Exchange server is on the same LAN if that's what you mean.</description>
      <pubDate>Sat, 02 Mar 2002 02:43:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674995#M917270</guid>
      <dc:creator>Michael Skora</dc:creator>
      <dc:date>2002-03-02T02:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: telnet port 25 script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674996#M917271</link>
      <description>Michael,&lt;BR /&gt;&lt;BR /&gt;Use perl and it's telnet modules.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.perldoc.com/cpan/Net/Telnet.html" target="_blank"&gt;http://www.perldoc.com/cpan/Net/Telnet.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.perlfect.com/articles/telnet.shtml" target="_blank"&gt;http://www.perlfect.com/articles/telnet.shtml&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://modperl.com:9000/perl_networking/sample/ch6.html" target="_blank"&gt;http://modperl.com:9000/perl_networking/sample/ch6.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Sat, 02 Mar 2002 02:44:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674996#M917271</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-03-02T02:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: telnet port 25 script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674997#M917272</link>
      <description>What kind of system you running this on. &lt;BR /&gt;If UNIX what is it - do:&lt;BR /&gt;#uname -a&lt;BR /&gt;&lt;BR /&gt;also do:&lt;BR /&gt;# echo $SHELL&lt;BR /&gt;&lt;BR /&gt;You're not getting out of the script - need more info.&lt;BR /&gt;&lt;BR /&gt;Jeff</description>
      <pubDate>Sat, 02 Mar 2002 02:49:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674997#M917272</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2002-03-02T02:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: telnet port 25 script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674998#M917273</link>
      <description>Jeff - &lt;BR /&gt;&lt;BR /&gt;# uname -a gives:&lt;BR /&gt;HP-UX hawk04uk B.10.20 U 9000/859 1439525301 unlimited-user license&lt;BR /&gt;&lt;BR /&gt;# echo $SHELL gives:&lt;BR /&gt;/sbin/sh</description>
      <pubDate>Sat, 02 Mar 2002 02:54:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674998#M917273</guid>
      <dc:creator>Michael Skora</dc:creator>
      <dc:date>2002-03-02T02:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: telnet port 25 script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674999#M917274</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Try using expect. This works for me but you have to customize my script based on your (eg. not SST) mail server's returning messages.&lt;BR /&gt;&lt;BR /&gt;I have stripped my script down for ease of customization as follows:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/expect&lt;BR /&gt;&lt;BR /&gt;set timeout 10&lt;BR /&gt;spawn telnet a.b.c.d 25&lt;BR /&gt;expect_background -re .+&lt;BR /&gt;expect "(SST)"&lt;BR /&gt;send "mail from: a@x.y.z\n"&lt;BR /&gt;expect "Sender ok"&lt;BR /&gt;send "rcpt to: z@a.b.c\n"&lt;BR /&gt;expect "Recipient ok"&lt;BR /&gt;send "data\n"&lt;BR /&gt;expect "by itself"&lt;BR /&gt;send "Your message here.\n"&lt;BR /&gt;send ".\n";&lt;BR /&gt;expect "Message accepted for delivery"&lt;BR /&gt;close                                                       &lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Sat, 02 Mar 2002 03:10:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2674999#M917274</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-03-02T03:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: telnet port 25 script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2675000#M917275</link>
      <description>If you're HP-UX system has sendmail running on it &amp;amp; been set to relay to that host you're trying to telnet to - then there's another way to do it.&lt;BR /&gt;&lt;BR /&gt;To see if the above conditions are true try this:&lt;BR /&gt;&lt;BR /&gt;#echo test | mailx -s "This is a test" mike.skora@hawker.com &lt;BR /&gt;&lt;BR /&gt;the -s is for subject&lt;BR /&gt;&lt;BR /&gt;If this gets thru then you can pipe whatever you want into mailx commands.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Jeff</description>
      <pubDate>Sat, 02 Mar 2002 03:17:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2675000#M917275</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2002-03-02T03:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: telnet port 25 script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2675001#M917276</link>
      <description>The Ctrl C is just kiling your telnet session.  Then it goes on to do the rest of your program which is why outlook picks it up.&lt;BR /&gt;&lt;BR /&gt;First if you manually telnet to 193.0.9.27 25 does it answer?&lt;BR /&gt;&lt;BR /&gt;If it answers, can you type in what you have in your script and does that work?&lt;BR /&gt;&lt;BR /&gt;If the above are true then try rewriting your script to look more like:&lt;BR /&gt;&lt;BR /&gt;(sleep 5 &lt;BR /&gt;echo "username\r" &lt;BR /&gt;sleep 5 &lt;BR /&gt;echo "password\r" &lt;BR /&gt;sleep 15 &lt;BR /&gt;echo "date" &lt;BR /&gt;sleep 5 &lt;BR /&gt;echo exit) |telnet otherboxipaddress portno&lt;BR /&gt;&lt;BR /&gt;This is similar to what I use to talk to a 3Com switch.  If I talk to a Cisco router I do not need the \r (I think I have the \ direction right.  Working from my poor memory here. Could be /r.  Not sure.)  You have to substitute the appropriate values in each echo statement.  The sleep statements are important and may need adjusting depending on how slow your remote system is. If, when you talk to the remote box, you have to give it an enter to wake it up that's echo "\r" or just echo.&lt;BR /&gt;&lt;BR /&gt;Ron&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 02 Mar 2002 12:33:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2675001#M917276</guid>
      <dc:creator>Ron Kinner</dc:creator>
      <dc:date>2002-03-02T12:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: telnet port 25 script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2675002#M917277</link>
      <description>As others have mentioned, you need something like the 'expect' program to solve the (non-)handshaking issue. telnet(1) is intended for *interactive* use and does not work in 'batch-mode'.&lt;BR /&gt;&lt;BR /&gt;Having said that, *why* are you using telnet(1) to the SMTP port? Why don't you use sendmail(1M) to do the work for you? You can just pipe the header lines, a blank 'separation' line and the body lines to "sendmail -t". Or do you need to control the envelope (sp?) in addition to the headers and body?</description>
      <pubDate>Wed, 06 Mar 2002 11:42:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2675002#M917277</guid>
      <dc:creator>Frank Slootweg</dc:creator>
      <dc:date>2002-03-06T11:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: telnet port 25 script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2675003#M917278</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you use the "!"- character as EOF- marker. In my opinion this could be the problem. Try another EOF- marker, like "EOF".&lt;BR /&gt;&lt;BR /&gt;Allways stay on the bright side of life!&lt;BR /&gt;&lt;BR /&gt;Peter</description>
      <pubDate>Wed, 06 Mar 2002 11:46:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2675003#M917278</guid>
      <dc:creator>Peter Kloetgen</dc:creator>
      <dc:date>2002-03-06T11:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: telnet port 25 script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2675004#M917279</link>
      <description>Thanks to all for your suggestions.&lt;BR /&gt;Harry - I looked at your perl references, but got lost pretty quickly.&lt;BR /&gt;Steven - played with 'expect' but got lost there too.&lt;BR /&gt;Ron - manually entering each line of the script works - apparently since telnet is intended to be interactive only.  Tried the sleep'ing suggestions but still couldn't get it to exit and complete.&lt;BR /&gt;Peter - tried a few other EOF marks, but with no success.&lt;BR /&gt;Jeff - 'mailx' fails because I messed up my sendmail configuration a while ago.  That's why I was trying something "simple" like telnet.&lt;BR /&gt;Frank - telnet seemed like a good idea and easier than fumbling my way through the sendmail configuration.  Apparently that's where I need to go though.  Anyone know a good sendmail class I could attend?&lt;BR /&gt;Thanks again - I give.</description>
      <pubDate>Wed, 06 Mar 2002 19:29:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2675004#M917279</guid>
      <dc:creator>Michael Skora</dc:creator>
      <dc:date>2002-03-06T19:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: telnet port 25 script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2675005#M917280</link>
      <description>Michael,&lt;BR /&gt;&lt;BR /&gt; Get the O'Reilly sendmail book - it's the "bat" book &amp;amp; while it's certainly comprehensive, it shouldn't be too over your head as long as you don't dwell on the rulesets - they've been known to make a person blind ;~). You want to focus on the configuration fields - EX:  Setting=Value&lt;BR /&gt;&lt;BR /&gt;And it explains the sendmail.cf &amp;amp; sendmail.cw files very well in addition.&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jeff</description>
      <pubDate>Wed, 06 Mar 2002 20:12:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2675005#M917280</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2002-03-06T20:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: telnet port 25 script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2675006#M917281</link>
      <description>Michael,&lt;BR /&gt;&lt;BR /&gt; And in case you do want to go the class route - here's a link:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.sendmail.org/classes.html" target="_blank"&gt;http://www.sendmail.org/classes.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jeff</description>
      <pubDate>Wed, 06 Mar 2002 20:25:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2675006#M917281</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2002-03-06T20:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: telnet port 25 script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2675007#M917282</link>
      <description>If you only need this, i.e. things like the example in your original posting, then you do not need a sendmail class. As I mentioned, you can just feed the stuff to "sendmail -t". Just a small (partial) example:&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;    echo "To: $TO"&lt;BR /&gt;    echo "From: $FROM"&lt;BR /&gt;    echo "Subject: $SUBJECT"&lt;BR /&gt;    echo "Date: $DATE"&lt;BR /&gt;    if [ ! -z "$MIME_Version" ]&lt;BR /&gt;    then&lt;BR /&gt;        echo "$MIME_Version"&lt;BR /&gt;    fi&lt;BR /&gt;    if [ ! -z "$Content_Type" ]&lt;BR /&gt;    then&lt;BR /&gt;        echo "$Content_Type"&lt;BR /&gt;    fi&lt;BR /&gt;    if [ ! -z "$boundary" ]&lt;BR /&gt;    then&lt;BR /&gt;        echo "$boundary"&lt;BR /&gt;    fi&lt;BR /&gt;    echo                        # Blank line because the body starts here:&lt;BR /&gt;    cat /tmp/body$$&lt;BR /&gt;} | sendmail -t&lt;BR /&gt;&lt;BR /&gt;I hope this helps.</description>
      <pubDate>Thu, 07 Mar 2002 08:34:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2675007#M917282</guid>
      <dc:creator>Frank Slootweg</dc:creator>
      <dc:date>2002-03-07T08:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: telnet port 25 script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2675008#M917283</link>
      <description>Thanks again to all for your help.  Finally resolved it by doing the right thing - getting sendmail to work.  &lt;BR /&gt;1) '/etc/hosts' has to have the correct domainname aliases associated with the Exchange server ip.&lt;BR /&gt;2) '/etc/mail/sendmail.cf' needs the correct domainname (eg: Dj$w.hawker.com in my case).&lt;BR /&gt;3) and '/etc/mail/sendmail.cw' needed 3 entries: hawk01us, hawk01us.hawker, and hawk01us.hawker.com to be happy.&lt;BR /&gt;After restarting the sendmail daemon with '# /sbin/init.d/sendmail stop' and then '# /sbin/init.d/sendmail start' I was able to execute "# mailx -s 'Happy at last' mike.skora@hawker.com &amp;lt; filename.txt" and see it in my Outlook inbox.  Now I can go home.</description>
      <pubDate>Thu, 14 Mar 2002 23:18:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/telnet-port-25-script/m-p/2675008#M917283</guid>
      <dc:creator>Michael Skora</dc:creator>
      <dc:date>2002-03-14T23:18:32Z</dc:date>
    </item>
  </channel>
</rss>

