LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 11-21-2006, 11:33 PM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,428

Rep: Reputation: 53
Fail to telnet localhost 25


Hi folks,

Ubuntu-6.06.1-LAMP-server-amd64

I followed Section "11 Postfix With SMTP-AUTH And TLS" on
http://www.howtoforge.com/perfect_setup_ubuntu_6.06_p5

to config LAMP server. Encountered problem on running;
$ sudo telnet localhost 25
Code:
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 server1.example.com ESMTP Postfix (Ubuntu)

(hanging here sometimes - then popup)

421 server1.example.com Error: timeout exceeded
Connection closed by foreign host.
Please advise how to fix the problem.

TIA


B.R.
satimis
 
Old 11-22-2006, 02:40 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Quote:
(hanging here sometimes - then popup)
It's not hanging. It's waiting for you to start giving smtp commands and after a while it just timeouts. After connecting try something like:
Code:
ehlo yourdomain.com
 
Old 11-22-2006, 05:05 AM   #3
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,428

Original Poster
Rep: Reputation: 53
Hi bathory,

Quote:
It's not hanging. It's waiting for you to start giving smtp commands and after a while it just timeouts. After connecting try something like:
Code:
ehlo yourdomain.com
I got it. It was wasting for my input.

$ sudo /etc/init.d/saslauthd restart
Password:
Code:
Stopping SASL Authentication Daemon: saslauthd.
Starting SASL Authentication Daemon: saslauthd.
$ sudo telnet localhost 25
Code:
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 server1.example.com ESMTP Postfix (Ubuntu)

(it was waiting here.  Then I typed)
ehlo localhost
250-server1.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250 8BITMIME

(it was further waiting here.  Then I typed)
quit
221 Bye
Connection closed by foreign host.
Tks.


B.R.
satimis
 
Old 11-22-2006, 05:10 AM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
You can use the following smtp commands to send an email
Code:
telnet localhost 25
ehlo yourdomain.com
mail from: you@yourdomain.com
rcpt to: recipient@otherdomain.com
data
subject: Whatever subject you want
blah blah
blah blah
.
Always finish your mail with a dot "."
 
Old 11-22-2006, 06:02 AM   #5
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,428

Original Poster
Rep: Reputation: 53
Hi bathory,

Tks for your advice.

Quote:
You can use the following smtp commands to send an email
Code:
telnet localhost 25
ehlo yourdomain.com
mail from: you@yourdomain.com
rcpt to: recipient@otherdomain.com
data
subject: Whatever subject you want
blah blah
blah blah
.
Always finish your mail with a dot "."
I haven't registered a domain yet. How can I perform this test? TIA


B.R.
satimis
 
Old 11-22-2006, 06:17 AM   #6
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Well you can use whatever domain you want (existing or not existing) as yourdomain.com (you can also leave it as is or use localhost) and a valid email address to get the email (replace recipient@otherdomain.com).
But keep in mind that most mailservers do not accept mail from a host who's IP does not resolve to a domain. So you can test it locally (i.e send an email from you to yourself).
 
Old 11-22-2006, 06:46 AM   #7
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,428

Original Poster
Rep: Reputation: 53
Hi bathory,

Quote:
Well you can use whatever domain you want (existing or not existing) as yourdomain.com (you can also leave it as is or use localhost) and a valid email address to get the email (replace recipient@otherdomain.com).
But keep in mind that most mailservers do not accept mail from a host who's IP does not resolve to a domain. So you can test it locally (i.e send an email from you to yourself).
Performed 2 tests as follows;

1)
$ telnet localhost 25
Code:
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 server1.example.com ESMTP Postfix (Ubuntu)
ehlo satimis.com
250-server1.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250 8BITMIME
mail from:myself@satimis.com
250 Ok
rcpt to: satimis@abc.com
250 Ok
data
354 End data with <CR><LF>.<CR><LF>
subject: Test
this is a test.  This is a test, a test, a test
.
250 Ok: queued as 91384754034

(It is waiting here.  What shall I input?)
421 server1.example.com Error: timeout exceeded
Connection closed by foreign host.
Failed.


2)
$ sudo telnet localhost 25
Password:
Code:
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 server1.example.com ESMTP Postfix (Ubuntu)
ehlo satimis.com
250-server1.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250 8BITMIME
mail from: myself@satimis.com
250 Ok
rcpt to: satimis@abc.com
250 Ok
data
354 End data with <CR><LF>.<CR><LF>
subject:Test
This is a test, a test, a test
<CR><LF>.<CR><LF>
.
250 Ok: queued as BD396754040

(It is still waiting here}
Also failed

Furthermore sending a email to myself I still have to going through ISP. I think I have to register a free domain to continue this test.

Tks.

B.R.
satimis
 
Old 11-22-2006, 07:06 AM   #8
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Quote:
(It is still waiting here}
After the dot that end the mail data you must give quit to quit the telnet session.
Instead of rcpt to: satimis@abc.com (I guess it's not real), why don't you use rcpt to: satimis@localhost to see if you can send/receive locally (assuming the user satimis exists) and use whatever account you have in webmail services like gmail, hotmail etc to see if you can send outside your box.
 
Old 11-22-2006, 07:33 AM   #9
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,428

Original Poster
Rep: Reputation: 53
Hi bathory,

Further test;

$ telnet localhost 25
Code:
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 server1.example.com ESMTP Postfix (Ubuntu)
ehlo satimis.com
250-server1.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250 8BITMIME
mail from: myself@satimis.com
250 Ok
rcpt to: satimis@localhost
250 Ok
data
354 End data with <CR><LF>.<CR><LF>
subject: Test
This is a test, a test, a test
.
250 Ok: queued as CEAE9754049
quit
221 Bye
Connection closed by foreign host.
You have new mail in /var/mail/satimis
$ nano /var/mail/satimis

Yes I received the mail.


Also sent it to webmail a/c on yahoo.com. But up to the time of writing I haven't received it.


Others noted with tks.


B.R.
satimis
 
Old 11-22-2006, 08:00 AM   #10
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Quote:
Also sent it to webmail a/c on yahoo.com. But up to the time of writing I haven't received it.
Most likely you're not going to receive it since your IP must resolve to a valid hostname. If that's not true the other mailserver rejects the message to prevent spam.

Regards
 
Old 11-22-2006, 01:09 PM   #11
Quigi
Member
 
Registered: Mar 2003
Location: Cambridge, MA, USA
Distribution: Ubuntu (Dapper and Heron)
Posts: 377

Rep: Reputation: 31
Quote:
Originally Posted by satimis
Also sent it to webmail a/c on yahoo.com. But up to the time of writing I haven't received it.
Quote:
Originally Posted by bathory
Most likely you're not going to receive it since your IP must resolve to a valid hostname. If that's not true the other mailserver rejects the message to prevent spam.
Yes, Yahoo is picky. To see yourself what your mailer is encountering, you can talk to them just like you talk to your own SMTP server:
Code:
telnet a.mx.mail.yahoo.com 25
Normally you get "Message temporarily deferred", and the door slammed in your face. It's not really temporary -- it'll never work. See http://help.yahoo.com/help/us/mail/defer/defer-06.html
To fix, go to http://add.yahoo.com/fast/help/us/mail/cgi_defer and tell them your IP address is not "naughty". Yes, they take your word for it. Since I told then that my IP was "nice", their SMTP server has been polite, and I just sent myself a mail.

You reported this experiment:
Code:
354 End data with <CR><LF>.<CR><LF>
subject: Test
This is a test, a test, a test
.
"Subject" should be capitalized. And there should be an empty line between the headers (Subject, Date, From, To, ...) and the body of the message.
Quote:
Originally Posted by http://www.ietf.org/rfc/rfc2822
A message consists of header fields (collectively called "the header
of the message") followed, optionally, by a body. The header is a
sequence of lines of characters with special syntax as defined in
this standard. The body is simply a sequence of characters that
follows the header and is separated from the header by an empty line
(i.e., a line with nothing preceding the CRLF).
 
Old 11-22-2006, 08:47 PM   #12
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,428

Original Poster
Rep: Reputation: 53
Hi Quigi,

Tks for your advice.

Quote:
To see yourself what your mailer is encountering, you can talk to them just like you talk to your own SMTP server:
Code:
telnet a.mx.mail.yahoo.com 25
Performed 2 tests as follows;

1)
$ telnet a.mx.mail.yahoo.com 25
Code:
Trying 209.191.118.103...
quit
$ whois 209.191.118.103
Code:
OrgName:    Yahoo!
OrgID:      YAOO
Address:    701 First Ave
City:       Sunnyvale
StateProv:  CA
PostalCode: 94089
Country:    US

NetRange:   209.191.64.0 - 209.191.127.255
CIDR:       209.191.64.0/18
NetName:    A-YAHOO-US3
NetHandle:  NET-209-191-64-0-1
Parent:     NET-209-0-0-0-0
NetType:    Direct Allocation
NameServer: NS1.YAHOO.COM
NameServer: NS2.YAHOO.COM
NameServer: NS3.YAHOO.COM
NameServer: NS4.YAHOO.COM
NameServer: NS5.YAHOO.COM
Comment:
RegDate:    2005-05-20
Updated:    2005-07-21

RAbuseHandle: NETWO857-ARIN
RAbuseName:   Network Abuse
RAbusePhone:  +1-408-349-3300
RAbuseEmail:  network-abuse@cc.yahoo-inc.com

OrgAbuseHandle: NETWO857-ARIN
OrgAbuseName:   Network Abuse
OrgAbusePhone:  +1-408-349-3300
OrgAbuseEmail:  network-abuse@cc.yahoo-inc.com

OrgTechHandle: NA258-ARIN
OrgTechName:   Netblock Admin
OrgTechPhone:  +1-408-349-3300
OrgTechEmail:  netblockadmin@yahoo-inc.com

# ARIN WHOIS database, last updated 2006-11-21 19:10
# Enter ? for additional hints on searching ARIN's WHOIS database.
The IP address is Yahoo.


2)
without "a.mx."

$ telnet mail.yahoo.com 25
Code:
Trying 209.73.168.74...
quit
$ whois 209.73.168.74
Code:
OrgName:    AltaVista Company
OrgID:      ALTAVI-1
Address:    701 First Ave
City:       Sunnyvale
StateProv:  CA
PostalCode: 94089
Country:    US

NetRange:   209.73.160.0 - 209.73.191.255
CIDR:       209.73.160.0/19
NetName:    INTERNET-BLK-1-AV
NetHandle:  NET-209-73-160-0-1
Parent:     NET-209-0-0-0-0
NetType:    Direct Assignment
NameServer: NS1.YAHOO.COM
NameServer: NS2.YAHOO.COM
NameServer: NS3.YAHOO.COM
NameServer: NS4.YAHOO.COM
NameServer: NS5.YAHOO.COM
Comment:
RegDate:    2000-06-08
Updated:    2004-05-21

RTechHandle: NA258-ARIN
RTechName:   Netblock Admin
RTechPhone:  +1-408-349-3300
RTechEmail:  netblockadmin@yahoo-inc.com

OrgAbuseHandle: NETWO857-ARIN
OrgAbuseName:   Network Abuse
OrgAbusePhone:  +1-408-349-3300
OrgAbuseEmail:  network-abuse@cc.yahoo-inc.com

OrgTechHandle: NA258-ARIN
OrgTechName:   Netblock Admin
OrgTechPhone:  +1-408-349-3300
OrgTechEmail:  netblockadmin@yahoo-inc.com

# ARIN WHOIS database, last updated 2006-11-21 19:10
# Enter ? for additional hints on searching ARIN's WHOIS database.
The IP address is AltaVista Company.

What is "a.mx."?

Quote:
To fix, go to http://add.yahoo.com/fast/help/us/mail/cgi_defer and tell them your IP address is not "naughty".
Sent Yahoo following info;
Code:
1. What is your name
myname

2. What is your email address
myname@yahoo.com

3. What domain(s) are you contacting us about
satimis.com

4. Indicate the specifi IP address of the mail server experiencing the issue
myself@satimis.com

Please enter your feedback
No mail received
An acknowledge webmail was received from Yahoo.


Sent myself a webmail as follow;

$ telnet localhost 25
Code:
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 server1.example.com ESMTP Postfix (Ubuntu)
ehlo satimis.com
250-server1.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250 8BITMIME
mail from: myself@satimis.com
250 Ok
rcpt to: myname@yahoo.com
250 Ok
data
354 End data with <CR><LF>.<CR><LF>

Subject: Test

This is a test, a test, a test
.
250 Ok: queued as 58B9D75404C
quit
221 Bye
Connection closed by foreign host.
But the webmail never come. I have been waiting for more than half hour. Just checked Yahoo website before answering this thread.

Others noted with Tks


B.R.
satimis
 
Old 11-22-2006, 08:50 PM   #13
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,428

Original Poster
Rep: Reputation: 53
Quote:
Originally Posted by bathory
Well you can use whatever domain you want (existing or not existing) as yourdomain.com (you can also leave it as is or use localhost) and a valid email address to get the email (replace recipient@otherdomain.com).
But keep in mind that most mailservers do not accept mail from a host who's IP does not resolve to a domain. So you can test it locally (i.e send an email from you to yourself).
Noted with tks.

I suppose your advice sending mails is the backend. The front end software will be evolution, thunderbird, etc.? Tks.


B.R.
satimis
 
Old 11-24-2006, 01:26 PM   #14
Quigi
Member
 
Registered: Mar 2003
Location: Cambridge, MA, USA
Distribution: Ubuntu (Dapper and Heron)
Posts: 377

Rep: Reputation: 31
Quote:
Originally Posted by satimis
$ telnet a.mx.mail.yahoo.com 25
Code:
Trying 209.191.118.103...
quit
It seems that you cannot even establish a connection. That's not what I get from Yahoo. Possibly you ISP is blocking port 25? (Some are nasty.) Try any other host (non Yahoo). You have to fix this first.

Quote:
2)
without "a.mx."
You changed the name. By chance, there happens to be a host "mail.yahoo.com".
Quote:
The IP address is AltaVista Company.
That's indeed odd, but don't worry about it.
Quote:
What is "a.mx."?
Arbitrary substring of the hostname You cannot pick it apart like that. (Apart from domain ownership/delegation considerations below yahoo.com, which shouldn't bohther you.)
But you may wonder how I got the name. Here's how:
1) You want to send mail to, say, "satimis@yahoo.com"
2) The mail domain is the part after the '@', i.e., "yahoo.com".
3) Find which hosts handle mail for that domain:
Code:
host -t mx yahoo.com
4) Pick one of the results. Not sure, but I think lower score is "better", i.e., what the owner of the MX records prefers you to use. Out of the 8 answers that I got for "yahoo.com", I picked "a.mx.yahoo.com"
5) To send mail, carry an SMTP dialog (port 25) with that host.


Quote:
Sent Yahoo following info;
Code:
1. What is your name
myname

2. What is your email address
myname@yahoo.com

3. What domain(s) are you contacting us about
satimis.com

4. Indicate the specifi IP address of the mail server experiencing the issue
myself@satimis.com
An IP address is four bytes, usually written as dotted (decimal) quad, e.g., 66.45.232.66.

Quote:
Sent myself a webmail as follow;
$ telnet localhost 25
If you cannot connect to Yahoo's, it's unlikely
 
Old 11-24-2006, 08:27 PM   #15
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,428

Original Poster
Rep: Reputation: 53
Hi Quigi,

Quote:
It seems that you cannot even establish a connection. That's not what I get from Yahoo. Possibly you ISP is blocking port 25? (Some are nasty.) Try any other host (non Yahoo). You have to fix this first.
Now I have "satimis.homelinux.com", a free domain with dynamic IP, registered with dyndns.org.

I suppose my email address there is "satimis@satimis.homelinux.com". If I'm wrong please correct me.

Performed another test as follow:

$ telnet localhost 25
Code:
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 server1.example.com ESMTP Postfix (Ubuntu)
ehlo satimis.homelinux.com
250-server1.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250 8BITMIME
mail from: satimis@satimis.homelinux.com
250 Ok
rcpt to: satimis@writeme.com
250 Ok

data
354 End data with <CR><LF>.<CR><LF>

Subject: Test

This is a test, test
.
250 Ok: queued as D203375405C
quit
221 Bye
Connection closed by foreign host.
The email never arrived.

$ host -t mx writeme.com
Code:
writeme.com mail is handled by 10 writeme-com.mr.outblaze.com.
writeme.com mail is handled by 20 writeme-com-bk.mr.outblaze.com.
$ telnet writeme-com-bk.mr.outblaze.com 25
Code:
Trying 64.71.166.195...
it only hanging here.

How to check whether port 25 is blocked by ISP? If YES how to by-pass this blockage? Tks.

Quote:
Sent Yahoo following info;

1. What is your name
myname

2. What is your email address
myname@yahoo.com

3. What domain(s) are you contacting us about
satimis.com

4. Indicate the specifi IP address of the mail server experiencing the issue
myself@satimis.com
I suppose I have to change them as;
Code:
1. What is your name 
satimis

2. What is your email address 
satimis@yahoo.com 

3. What domain(s) are you contacting us about 
satimis.homelinux.com 

4. Indicate the specifi IP address of the mail server experiencing the issue 
satimis@satimis.homelinux.com
I haven't sent them yet. I have to sort out "port 25" problem first.

Tks.


B.R.
satimis
 
  


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
telnet localhost problem SchwipSchwap Linux - Newbie 10 03-15-2011 02:21 AM
Can ping to localhost but cannot telnet sreeramabsc Linux - Networking 5 04-02-2006 07:46 AM
Telnet problem and localhost zillah Linux - Wireless Networking 6 06-07-2005 03:34 PM
can not telnet localhost 25 but telnet dowell.exper.dynserv.com 25 exper Linux - Software 0 02-25-2004 06:13 AM
Telnet localhost and telnet not from localhost for IMAP services seb77 Linux - Networking 1 10-15-2003 02:20 PM


All times are GMT -5. The time now is 01:23 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration