Remote Connection to Sendmail

Hi guys,

Trying to get sendmail to accept connections from any domain and am having some real troubles. A few questions.

Code:
Bash >telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.rcn.com.
Escape character is '^]'.
220 sporkit.hopto.org ESMTP Sendmail 8.14.3/8.14.3; Wed, 5 May 2010 16:58:40 -0500 (CDT)
quit
221 2.0.0 sporkit.hopto.org closing connection
Connection closed by foreign host.

Bash >hostname
sporkit.hopto.org

I can access the server through localhost no problem. What is up with the rcn.com hostname though? They're not even my isp anymore. You can see my hostname is set as sporkit.hopto.org. I've looked for where this configuration can be changed, but am not seeing anything.

Code:
Bash >telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 sporkit.hopto.org ESMTP Sendmail 8.14.3/8.14.3; Wed, 5 May 2010 16:58:48 -0500 (CDT)
quit
221 2.0.0 sporkit.hopto.org closing connection
Connection closed by foreign host.

Connecting through 127.0 I can still access the server.

Code:
Bash >telnet 192.168.1.155 25
Trying 192.168.1.155...
telnet: connect to address 192.168.1.155: Connection refused
telnet: Unable to connect to remote host
Bash >

155 is the address of my server itself. So I believe this request bonces from my router back to the box. Shouldn't I be able to connect to my box like this? Where can I allow 192.168.1.1 to connect? How can I open up sendmail to receive from anybody?

I believe my ISP is blocking incoming on port 25, so I would first like to verify connectivity before I go accusing them of blocking my traffic.

Any help appreciated! Thanks!
 
sporkit said:
Hi guys,

Trying to get sendmail to accept connections from any domain and am having some real troubles. A few questions.

Code:
Bash >telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.rcn.com.
Escape character is '^]'.
220 sporkit.hopto.org ESMTP Sendmail 8.14.3/8.14.3; Wed, 5 May 2010 16:58:40 -0500 (CDT)
quit
221 2.0.0 sporkit.hopto.org closing connection
Connection closed by foreign host.

Bash >hostname
sporkit.hopto.org

I can access the server through localhost no problem. What is up with the rcn.com hostname though? They're not even my isp anymore. You can see my hostname is set as sporkit.hopto.org. I've looked for where this configuration can be changed, but am not seeing anything.

Check /etc/hosts
Code:
Bash >telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 sporkit.hopto.org ESMTP Sendmail 8.14.3/8.14.3; Wed, 5 May 2010 16:58:48 -0500 (CDT)
quit
221 2.0.0 sporkit.hopto.org closing connection
Connection closed by foreign host.

Connecting through 127.0 I can still access the server.

Code:
Bash >telnet 192.168.1.155 25
Trying 192.168.1.155...
telnet: connect to address 192.168.1.155: Connection refused
telnet: Unable to connect to remote host
Bash >

155 is the address of my server itself. So I believe this request bonces from my router back to the box. Shouldn't I be able to connect to my box like this? Where can I allow 192.168.1.1 to connect? How can I open up sendmail to receive from anybody?

I believe my ISP is blocking incoming on port 25, so I would first like to verify connectivity before I go accusing them of blocking my traffic.

Any help appreciated! Thanks!

Sendmail listens on 127.0.0.1 only by default. You need to add sendmail_enable="YES" to /etc/rc.conf to make sendmail listen to network as well.
 
crsd said:
Check /etc/hosts


Sendmail listens on 127.0.0.1 only by default. You need to add sendmail_enable="YES" to /etc/rc.conf to make sendmail listen to network as well.

I COULD SHOOT MYSELF......

I've been compiling and configuring /etc/mail/freebsd.mc for two days now. I've had this working in the past and knew I was doing something stupid.

Here's a question. Where's the line between configuring something in rc.conf and the system leaving it up the program's respective configuration files? I looked through the documentation for sendmail in the freebsd docs, but never came across this. What should have tipped me off to set it there?
 
rc.sendmail(8), linked from rc.conf(5), but I have to agree that it isn't that easy to find that info.

And it would be easier/more correct to run `make` once in /etc/mail and to edit your `hostname`.mc instead.
 
crsd said:
Sendmail listens on 127.0.0.1 only by default. You need to add
Code:
sendmail_enable="YES"
to /etc/rc.conf to make sendmail listen to network as well.

Are you sure about that? I have not modified sendmail or its config in any way and have a pretty clean/fresh install of 8.2. When running sockstat -4l It shows sendmail listening remotely.

See output below.

Code:
[brad@moon /usr/home/brad]$ sockstat -4l
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS      
root     sendmail   1160  4  tcp4   127.0.0.1:25          *:*
 
The local address shows it's bound to localhost. Nothing 'remote' can connect to localhost.
 
Alright so I HOPE I figured it out. Please let me know if it's not the case. If there is no asterisk under local address, and foreign address is '*:*' that means the service is NOT listening remotely. True? If not, then I'm still confused based on my above post.

Or is it just simply, if the service has an address bound to 127.0.0.1 then it is only listening locally and all duplicate entries appearing in sockstat -4l are really same socket sharing the same PID? E.g

Code:
[brad@moon ~]$ sockstat -4l
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS
brad     ssh        1657  4  tcp4   127.0.0.1:6667        *:*
root     sendmail   1160  4  tcp4   127.0.0.1:25          *:*
root     ntpd       929   20 udp4   *:123                 *:*
root     ntpd       929   22 udp4   192.168.0.104:123     *:*
root     ntpd       929   25 udp4   127.0.0.1:123         *:*

Meaning that ntpd is only listening locally, and the entries for PID 929 are just listed since the socket is bound locally.

...Shouldn't this stuff be in the manpage?:\
 
A local address of *:<someport> means it's listening on all addresses of the host. If it's <ipaddress>:<someport> it's listening on that specific IP address.

Localhost or 127.0.0.1 can only connect to/from 127.0.0.0/8. This traffic will never enter or leave a host.

There's no place like 127.0.0.1 :e
 
Maybe I am wording my question wrong, I am more confused about the duplicate entries I guess, and the '*:*' showing in foreign, while it shows a connection in local too. So for the output in my above post, Is ntpd ONLY listening on local, hence the 127.0.0.1:123 entry, which would take precedence over the '*:*' in foreign? Again I was under the impression from the similar thread I opened up that the asterisks under foreign meant it was listening on all IP's. Sorry for the confusion but I really need to understand this output. Thanks
 
Just forget the 'Foreign Address' column. No one uses it for anything anyway. What is under 'Local Address' is what matters. If something only listens on 127.0.0.1 no one 'external' can connect to it using any of the server's physical interfaces (e.g. LAN, WAN). Again: just omit the 'Foreign Address' column, so it won't confuse you. It'll always be there and always look like that.
 
Back
Top