- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- telnet to mail server no interactive in automatic ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2005 07:56 AM
04-01-2005 07:56 AM
> (sendmail, postfix, etc) such as:
> #!/bin/bash
> telnet 1.2.3.4 25 << _EOF_
> HELO abc.com
> <- smtp conversation here (mail from, rcpt to, data, etc)
> _EOF_
>
> When I execute it, I get:
> 220 xyz.com ESMTP Sendmail 8.11.6/8.11.6; Fri, 11 Oct 2002
> 19:59:20 -0400
> Connection closed by foreign host.
>
> I've tried many ways to do it but it doesn't work. I've read somewhere that
> "telnet is not interactive so it will not work". I know Perl is much better
> and gives more control, but I want to do it first en bash script just for
> fun :) Any suggestion?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2005 08:06 AM
04-01-2005 08:06 AM
Re: telnet to mail server no interactive in automatic shell
It may be set to deny logins outside of the SNMP services.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2005 08:18 AM
04-01-2005 08:18 AM
Re: telnet to mail server no interactive in automatic shell
Check the /etc/mail/sendmail.cf on that system.
Look for PrivacyOptions and IF it's set to "goaway" then almost all SMTP status queries are disallowed.
If it's needmailhelo then the system will insist on an HELO or EHLO before it will allow any mail commands.
Also sendmail is *very* picky about name resolution. Make sure both the server & client are resolvable both forward (by name) & reverse (by IP). Sendmail will shoot you down if you're not.
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2005 11:00 PM
04-01-2005 11:00 PM
SolutionIf so, then the problem is your script.
Stuff like this should be done in perl.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=209253
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=696550
live free or die
harry d brown jr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2005 02:14 AM
04-04-2005 02:14 AM
Re: telnet to mail server no interactive in automatic shell
HTH,
Chuck Davis
#####
#!/usr/bin/perl -w
use Net::SMTP;
$usage =<
this script checks if an SMTP server is available on a server. run like this:
$0
script exits with 0 if SMTP is running, exits with 1 if SMTP not running.
EOF
;
if (@ARGV != 1)
{ print $usage;
exit;
}
$server = $ARGV[0];
if (Net::SMTP->new( $server, Timeout=>5))
{ print "SMTP on $server is UP\n";
exit 0
}
else
{ print "SMTP on $server is DOWN\n";
exit 1
}