Newsgroups: comp.mail.sendmail Date: 2001-05-18 22:18:00 PST
I'm trying to figure out how to set up sendmail to be a simple (Redhat 7.1 Linux) mailserver for my home network (192.168.0.x), with the mailserver machine also being the firewall.
When I log into the mailserver machine, I can connection to the port 25 via "telnet localhost smtp" just fine, BUT anything else, such as "telnet public_ip smtp", where public_ip is the public IP address of the machine, always gets me a connection refused.
A "netstat -tl" gets me:
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State ... tcp 0 0 coldresist.com:smtp *:* LISTEN ... You have new mail in /var/spool/mail/gerald
which suggests to me that something is listening, but somehow on only one IP address. What is the matter here? I'd appreciate it very much if someone can point me in the right direction.
I should probably make mention of the fact that I don't think it's my firewall, as even if I disable the firewall and allow everything through, I still get connection refused when trying to connect to the machine with anything other than "telnet localhost smtp". Sendmail just seems to be not listening on any other IP address. Can this be possible?
I would very much appreciate any help that anyone can give.
>"telnet localhost smtp" just fine, BUT anything else, such as "telnet >public_ip smtp", where public_ip is the public IP address of the machine, >always gets me a connection refused.
http://www.sendmail.org/faq/section5.html#5.3.3
Neil W Rickert
Date: December 4, 2002
Several vendors have changed the way that sendmail is run. They decided that most people need a client-only version of sendmail. So it is listening only on the localhost interface. Check the system documentation on how to change your .mc file. Here is a partial table of where some vendors ship their sendmail configuration hierarchy:
sendmail distribution ./cf Solaris /usr/lib/mail Red Hat 6.2 /usr/lib/sendmail-cf Red Hat 7 /usr/share/sendmail-cf Slackware 7.1 /usr/src/sendmail/cf
But you should check for yourself on your own system. When in doubt, do a find for "proto.m4", then go up the tree one level. When you find the .mc file, look for the string "DAEMON_OPTIONS" and for the comment lines near that string.
See also 5.3.1.3 for discussion about this problem as it relates specifically to Red Hat 7.1 and later.
Date: May 3, 2001 Updated: June 11, 2001 Updated: December 4, 2002
Red Hat, like some other vendors, changed the way that sendmail is run. (See 4.22 for a more general discussion of this problem.) They decided that most people need a client-only version of sendmail. So it is listening only on the localhost interface. Check the RH documentation on how to change that:
Make sure that you have installed the "sendmail-cf" package on your system — it should be on your install media.
Then check the file "sendmail.mc" (probably in "/etc/mail"). Look for the string "DAEMON_OPTIONS" and for the comment lines near that string.
Also note that Red Hat 7.1 and later build sendmail with tcpwrapper support, and provide a hosts.deny file that rejects all external mail. The sendmail:ALL addition to hosts.allow fixes this.
endmail-cf - The files needed to reconfigure Sendmail.
Without it:
% m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf /etc/mail/sendmail.mc:10: m4: Cannot open /usr/share/sendmail-cf/m4/cf.m4: No such file or directory
Tong
documented on: 2004.02.24 Tue
edit /etc/mail/sendmail.cf
comment out the DaemonPortOptions line as:
#O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA
service sendmail restart
telnet localhost smtp
ifconfig
then
telnet my_public_ip smtp
In a remote system,
telnet my_public_ip smtp