LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-15-2006, 02:18 AM   #1
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Rep: Reputation: 15
Question telnet problem


hi
im trying to telnet to our smtp server through port 25, but im getting connection closed error. Telnet is working fine for some ips..

The output i got while trying is...

Trying xx.xxx.xx.xx...
Connected to <remote host name>.com (xx.xxx.xx.xx).
Escape character is '^]'.
Connection closed by foreign host.

My /etc/hosts.allow and /etc/hosts.deny are empty..

can anyone tell me how to resolve this?

Thanks in advance
 
Old 05-15-2006, 04:17 AM   #2
okmyx
Member
 
Registered: May 2004
Location: Cornwall, UK
Distribution: Ubuntu 8.04
Posts: 464

Rep: Reputation: 31
Check your firewall and open the nessesary ports.
 
Old 05-15-2006, 04:26 AM   #3
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Original Poster
Rep: Reputation: 15
hi,
can you tell me how to check firewall settings? i checked /etc/services file and found telnet is running in default port 23 in my machine..

telnet 23/tcp
telnet 23/udp
# 24 - private mail system

/etc/xinetd.d/telnet looks like this..

# default: on
# description: The telnet server serves telnet sessions; it uses \
# unencrypted username/password pairs for authentication.
service telnet
{
disable = no
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}


is there any other files to be checked?
 
Old 05-15-2006, 04:29 AM   #4
taxtropel
Member
 
Registered: Mar 2005
Location: Cascade Mountains WA USA
Distribution: Linux From Scratch (LFS)
Posts: 149

Rep: Reputation: 16
if you are being told that you are connected to the remote host and what your escape char is, then you are not being restricted by your firewall. it simply looks like the remote host is disconnecting you? what is the exact command you are using to telnet in?

on a side note, for what purpose are you trying to telnet into your smtp server?
 
Old 05-15-2006, 04:42 AM   #5
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Original Poster
Rep: Reputation: 15
the command i used is

telnet xx.xxx.xx.xx 25

im configuring sendmail in my system and got some problems which i posted in another thread. Before proceeding further with sendmail config, i thought of checking whether im able to telnet to our smtp server and finally ended with one more thread with this problem..
Meanwhile im able to telnet to the smtp server from someother machines. Couldn understand what the problem is?
 
Old 05-15-2006, 05:37 AM   #6
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Your telnet connects to port 25 on the mail server alright.
I agree with taxtropel that your firewall can't be the problem. The mail server accepts the connection and then closes it.

Please keep in mind that the connection on port 25 is supposed to be used to send out commands following the SMTP protocol. If you don't send the commands fast enough, the mail server may simply "time out" and close the connection.

However, since the connection can be established, I don't see any problem for sendmail or any other program to send out mails to the server.

If you want to be sure that you can send out mails, either try issuing the SMTP commands at the telnet prompt (SMTP is a very easy protocol), or use a MUA (mail user agent - a simple mail program), configured to send out mails via SMTP to the server to test if you can send out mails. Your local sendmail configuration than doesn't play any part in it.
 
Old 05-15-2006, 05:45 AM   #7
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Original Poster
Rep: Reputation: 15
The reason for configuring sendmail is that i have to use it for two purposes, one is with bugzilla and other with my portal developed using python. since sendmail is the ideal one for those purposes, i chose it. We are using two servers here, one is already configured with sendmail and is working fine from where i can telnet to the smtp server. Im wondering what went wrong in this machine and want to figure it out. As you suggested i can go for MUA but i dont know how to use it with bugzilla and python.

is there any other output i should post here? im waiting for a solution..
 
Old 05-15-2006, 06:29 AM   #8
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
What does the Python code look like? Does it use a sendmail program directly? Or does it open a connection to your "mail server" via port 25 (SMTP)?

Have you checked the logfiles in /var/log?

Last edited by timmeke; 05-15-2006 at 06:31 AM.
 
Old 05-15-2006, 06:47 AM   #9
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by timmeke
What does the Python code look like? Does it use a sendmail program directly? Or does it open a connection to your "mail server" via port 25 (SMTP)?

Have you checked the logfiles in /var/log?

python code invokes sendmail directly.. but while invoking sendmail through python or by command directly im facing a deferred connection error.. the error im getting is

user@domain.com... Connecting to <smtp server> via hub...
user@domain.com... Deferred: Connection reset by <smtp server>
Closing connection to <smtp server>.

so after getting this i guessed both that telnet problem and this error are related and so i want to fix that first.. is both related?
if not than what may be reason for this bug?

i checked /var/log/messages, it doesnt have any message abt the telnet output.. is there any other log file dedicated for telnet?
 
Old 05-15-2006, 07:25 AM   #10
DENSVO
LQ Newbie
 
Registered: Apr 2006
Posts: 10

Rep: Reputation: 0
Could it be that your sendmail requires valid IP to hostname resolve by DNS? I think I had a similar problem with POP3 service.

Best regards,
Den
 
Old 05-15-2006, 07:39 AM   #11
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by DENSVO
Could it be that your sendmail requires valid IP to hostname resolve by DNS? I think I had a similar problem with POP3 service.

Best regards,
Den
i checked the same code in another server we have, it works without any problem.. The result i posted in my previous message shows the ouput when i invoked sendmail in shell..
 
Old 05-15-2006, 08:33 AM   #12
DENSVO
LQ Newbie
 
Registered: Apr 2006
Posts: 10

Rep: Reputation: 0
Quote:
Originally Posted by gobi_dgm
i checked the same code in another server we have, it works without any problem.. The result i posted in my previous message shows the ouput when i invoked sendmail in shell..
Is there a difference in resolv.conf between the two servers? Also in sendmail.mc see if it has:

FEATURE(`accept_unresolvable_domains')dnl


Best regards,
Den
 
Old 05-15-2006, 08:45 AM   #13
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by DENSVO
Is there a difference in resolv.conf between the two servers? Also in sendmail.mc see if it has:

FEATURE(`accept_unresolvable_domains')dnl


Best regards,
Den
Both the resolv.conf files are same.. nameserver and domain name is correct. The FEATURE u asked is also there in sendmail.mc . i checked file by file, though all the files are same, server one is working fine and other is not working. After trying all these i started writing my own cf file using the O'Reily sendmail book.. now im able to send mails to local users through that file but getting the same error as before for email ids. i donno wats going wrong?

with regards
gobi
 
Old 05-15-2006, 08:58 AM   #14
DENSVO
LQ Newbie
 
Registered: Apr 2006
Posts: 10

Rep: Reputation: 0
Quote:
Originally Posted by gobi_dgm
Both the resolv.conf files are same.. nameserver and domain name is correct. The FEATURE u asked is also there in sendmail.mc . i checked file by file, though all the files are same, server one is working fine and other is not working. After trying all these i started writing my own cf file using the O'Reily sendmail book.. now im able to send mails to local users through that file but getting the same error as before for email ids. i donno wats going wrong?
Maybe changing loglevel will let sendmail tell us more about what's going on. Could you change it to higher level and post here the output?

Best regards,
Den
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Running Telnet in a script, want to save Telnet output, howtodothis??? anil3 Linux - Software 2 03-08-2006 04:01 PM
telnet problem. bruse Linux - Networking 7 09-15-2005 09:47 AM
Telnet problem tripacer Linux - Software 4 05-25-2005 03:44 PM
telnet and su problem Tusharn Linux - Networking 1 01-16-2002 10:53 AM
telnet problem Arantila Linux - Newbie 2 12-02-2000 03:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration