Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

i am trying to set up email on my debian wheezy box. i can telnet to localhost on it like so:

$ telnet localhost 25
Connected to localhost.
Escape character is '^]'.
220 localhost.localdomain ESMTP Sendmail 8.14.4/8.14.4/Debian-2.1; Sat, 25 Aug 2012 22:55:52 +0930; (No UCE/UBE) logging access from: localhost(OK)-localhost []
HELO dfgsdfgsfgdfg
250 localhost.localdomain Hello localhost [], pleased to meet you
telnet> quit
Connection closed.

so this means i can send emails as localhost right? but i also want to receive them.

when i try to telnet to port 25 from my other pc on my own lan then it says:

$ telnet rpi 25
telnet: Unable to connect to remote host: Connection refused

also, nmap shows port 25 is closed to other machines on my lan:

$ nmap rpi -p25

Starting Nmap 5.00 ( ) at 2012-08-25 23:00 CST
Interesting ports on rpi (
25/tcp closed smtp

Nmap done: 1 IP address (1 host up) scanned in 0.15 seconds

how can i get port 25 open so i can receive emails?

i have read that installing postfix may do the trick. however i would like to keep my system as minimal as possible. is it possible to receive emails only using the smtp server?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Start by checking to see what ip addresses / interfaces are listening for SMTP. (netstat -na)

This would show that sendmail is only listening on the loopback and not your interfaces.

[nick@svr mail]$ netstat -na | grep 25
tcp        0      0      *                   LISTEN      
[nick@svr mail]$

You will need to edit /etc/mail/ , look for ....

dnl # The following causes sendmail to only listen on the IPv4 loopback address
dnl # and not on any other network devices. Remove the loopback
dnl # address restriction to accept email from the internet or intranet.
dnl #
DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')dnl

and replace the localhost ip with

run make to update the config, and restart the service... also check out this link ->

If after you have done all of that, don't forget to check your firewalls/iptables ;)


share|improve this answer
that works great thanks! i was actually just using for testing but i need to contact the box from the internet so i used ip address in /etc/mail/ to allow emails from anyone. – mulllhausen Aug 25 '12 at 14:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.