Discussion Locked

can't telnet to smtp

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm building a mail server and I'm currently stuck with a problem in smtp.
when I try "telnet localhost 25" on my mail server, to test if smtp is working, it just exits.
1) how do I check if smtp is blocked or being used by another service?
2) how do I configure smtp to use another port?
3) where do I look to see which port a service is using?

7 replies

by cg it

normally, port 25 is reserved for SMTP. "Other" services like FTP,WEB POP3 have their own default port so the chances of another service using port 25 [unless those services are manually configured to use a different port] are remote. When you say "just exits" do you get a blank screen? Also what mail software are you trying to use? E2K?

to get to the telnet prompt at the command prompt type telnet.exe then press enter. At the telnet prompt, type set_local echo , then press enter. Again, atthe telnet prompt type open25 press enter. You should now see the mail server info [if E2K it will give revision #]. next at the telnet prompt you can type hello or helo. the mail server should respond with a hello or a helo with command line information. you can also type ehlo and receive a response. The important thing it to set the loop back to the mail server by first typing in set_local echo at the telnet prompt.

to check open closed ports and what services are using what ports, use the netstat utility.

by alveden

Assuming that you are running linux with sendmail as your smtp. Would be good if you specified the os and the smtp server

1) Run "netstat -na | grep LISTEN"
You should see something like this ...
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN

This would confirm that a service is bind to port 25. Then run this
"sh /etc/init.d/sendmail status"
to check on the status for sendmail.

2) If you are planing to use it as a public mail server, it would not be advisable to change the port as all mail recieve publicly will have to be to port 25.

3) You can try running some sniffer software like tcpdump or ntop on port 25 to identify what is going on.

Please comment on your findings

by paulo.sedrez

1) "netstat -nap | grep ':25 .*LISTEN'"
The answer will include the name and PID of the process listening to TCP port 25.

2) On sendmail.cf, search the option "DaemonPortOptions", change to something like this:

-O DaemonPortOptions=Port=xxx, Addr=yyy, Name=MTA

where xxx is the port number or name to listen for and yyy is the address to listen at (if you want to listen to one address only).

3) now that is trick. To check which port a program is using: "netstat -nap | grep "; to check which port number correspond to a service: "grep /etc/services".

--Sedrez

This discussion is closed to new replies.