LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Cant Telnet SMTP (https://www.linuxquestions.org/questions/linux-server-73/cant-telnet-smtp-810440/)

pbaker 05-27-2010 07:19 AM

Cant Telnet SMTP
 
i have been following a guide to setup a mail server on CentOS. i have upto until now been able to send a test message and it arrives in the mailbox. However as part of te guide it wants me to go via terminal and type in. Telnet mail smtp.

mail being the host name of my machine but i get an error saying that the connection was refused.

what am i doing wrong or where do i need to look in order to resolve this.

druuna 05-27-2010 07:27 AM

Hi,

Try using the full name of the machine or its IP number (mail.foo.bar / 10.0.0.10). Also try changing smtp to 25 (portnumber that the service is listening on).

Hope this helps.

pbaker 05-27-2010 08:29 AM

what file is that in, as the only files i have edited are the postfix.mf and the dovecot.cf.

i think i got the extensions right.

druuna 05-27-2010 08:41 AM

Hi,

I'm not sure what you are talking about (your second post).

My idea was for your initial question: telnetting to your mail server. That command would look something like this (substitute your own name/ip):

telnet mail.foo.bar 25 or telnet 10.0.0.10 25

Have a look in your /etc/hosts file for the appropriate name or ip number.

Hope this helps.

pbaker 05-27-2010 08:56 AM

thank you i will try this and come back if this is still an issue.

pbaker 05-27-2010 03:47 PM

i have tried what you suggested and below is what i get back depending on what i have typed after putting in telnet.

[root@mail ~]# telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
Connection closed by foreign host.
[root@mail ~]# telnet 192.168.0.11
Trying 192.168.0.11...
telnet: connect to address 192.168.0.11: Connection refused
telnet: Unable to connect to remote host: Connection refused
[root@mail ~]# telnet 192.168.0.11 25
Trying 192.168.0.11...
telnet: connect to address 192.168.0.11: Connection refused
telnet: Unable to connect to remote host: Connection refused
[root@mail ~]# telnet mail.domain.eu 25
Trying 000.000.00.000...
telnet: connect to address 000.000.00.000: Connection refused
telnet: Unable to connect to remote host: Connection refused
[root@mail ~]#

druuna 05-28-2010 01:59 AM

Hi,

I'm not sure how CentOS sets up a mail server, but normally there should be a mail process listening on port 25. The following command shows if this is so:

netstat -plan | grep ":25"

This should show at least one process, it will also include the ip.

BTW: You mention in post #1 that mail is up and running. Can you send and receive mail?

Another thing that comes to mind: Do you use a firewall? If so, did you open the port?

Hope this helps.

pbaker 05-28-2010 04:37 AM

thank you i will try that when i get home. as part of there guide it gets you to send mail and see if its in the mailbox which it was showing.

i will let you know how i get on .

kool_kid 05-28-2010 04:49 AM

I assume that 192.168.0.11 is the IP of your mail server and mail.domain.eu is the name of that server. If this is true then edit /etc/hosts and add this line to it (if it already exist then ignore it)

192.168.0.11 mail.domain.eu mail

now issue the command

$telnet mail.domian.eu 25


If still you get the error then check firewall settings like druuna said.

pbaker 05-28-2010 04:11 PM

i tried what drunna said this is the reply i get

netstat -plan | grep ":25"
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2602/master

i also added 192.168.0.11 mail.domain.eu mail to my hosts file. The IP is listed is my internal IP that i have assigned my server not my external one by my isp.


All times are GMT -5. The time now is 07:22 PM.