LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   sendmail listening on port 25 (https://www.linuxquestions.org/questions/linux-software-2/sendmail-listening-on-port-25-a-79358/)

dskny 08-05-2003 09:24 PM

sendmail listening on port 25
 
when I do a netstat -nl

I get this:

tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN


I need to change it to:

tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN

but am having no luck.

I've edit the O DaemonPortOptions in sendmail.cf and even tried commenting it out completely. I am having no luck whatsoever.

I've added the ip to the /etc/mail/access file and still no luck...

I'm trying to dabble with iptables and I don't see anything for smtp

Please help...thanks

born4linux 08-05-2003 10:05 PM

have u restarted sendmail?

dskny 08-05-2003 10:16 PM

yup...after everytime I made a change

Corin 08-05-2003 10:24 PM

Why do you want to change it to 0.0.0.0 ?

That is the usually the address of a network, not a host.

dskny 08-06-2003 08:47 AM

it's only listening on the loopback...I need it to listen on all interfaces

Corin 08-06-2003 03:15 PM

First of all, in the new sendmail more secure scheme of operation , you have a process mqueue which picks up the mail messages from the host and then passed them on to sendmail for SMTP delivery.

So in you need in /etc/mail/submit.mc

divert(-1)
divert(0)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')
VERSIONID(`linux setup for Red Hat Linux')dnl
define(`confCF_VERSION', `Submit')dnl
define(`__OSTYPE__',`')dnl
define(`confTIME_ZONE', `USE_TZ')dnl
define(`confDONT_INIT_GROUPS', `True')dnl
define(`confPID_FILE', `/var/run/sm-client.pid')dnl
dnl #
FEATURE(`use_ct_file')dnl
dnl #
FEATURE(`msp', `[your_host.your_domain.COM]')dnl

Change your_host to real name of your host, and your_domain.COM to real_name of your domain.

In your sendmail.mc you need

sendmail.mc:DAEMON_OPTIONS(`Port=smtp,Addr=your_host.your_domain.COM,Name=MTA')dnl

and do not forget that in /etc/xinetd.d/smtp you need

#*****************************************************************************#
#
# file : /etc/xinetd.d/smtp
#
#*---------------------------------------------------------------------------*#
#
# description : The smtp server provides mail service.
#
service smtp
{
bind = <IP Number of your_host.your_domain.COM>
disable = no
log_on_failure += USERID
server = /usr/sbin/sendmail
server_args = -Am -bs
socket_type = stream
user = root
wait = no
}
#
#*****************************************************************************#


Once you have edited submit.mc and sendmai.mc you have to regenerate your *.cf files, so do

# cd /etc/mail
# make clean
# make

and you need to restart xinetd with

# /etc/init.d/xinetd restart

dskny 08-07-2003 01:38 PM

I've done that and still nothing. It's really odd. It just doesn't want to listen on any interfaces except 127.0.0.1

Thanks for the help anyways

Corin 08-07-2003 10:52 PM

So what happens when you

telnet non_loopback_ip 25

Corin 08-07-2003 10:54 PM

Using the settings I gave you above, I get

lsof -i | egrep smtp
xinetd 958 root 10u IPv4 2420 TCP myhost.mydomain.COM:smtp (LISTEN)

dskny 08-08-2003 08:38 AM

This is telnet response:
telnet: connect to address 192.168.1.140: Connection refused



sendmail 23641 root 4u IPv4 55698 TCP localhost:smtp (LISTEN)

Corin 08-08-2003 01:32 PM

So in your sendmail.cf and xinetd/smtp files you have not set the daemon to listen on your hostname.domain.COM but on your localhost (127.0.0.1).

The lsof clearly indicates that you have it only running on localhost.

Did you remember to do a

# cd /etc/mail
# make clean
# make

and /etc/init.d/xinetd restart after making the changes?

dskny 08-08-2003 02:58 PM

I am not using xinetd.

This is the Option in sendmail.cf

O DaemonPortOptions=Port=smtp, Name=MTA

I've left out the Addr pair because according to the bat book, if that is left out, it will allow connections from any network.

I've also tried that line with the Addr=[IP] and that doesn't work either.

Thanks

Corin 08-08-2003 03:44 PM

If you are not using xinetd, you should be :+)

It is standard since Red Hat 7.3 I think, and comes with SuSE 8.0

So you will need an entry in your inetd.conf file

smtp@your_ip_number stream tcp nowait root /usr/bin/tcpd /usr/sbin/sendmail -Am -bs

And do not forget to restart inetd with

/etc/init.d/inetd restart

dskny 08-11-2003 02:21 PM

thanks for the help, but the answer was actually in /etc/sysconfig/mail

for smtp to listen on remote addresses

Corin 08-12-2003 06:52 PM

Well on RedHat 9, there is no /etc/sysconfig/mail file.

There is however an /etc/sysconfig/sendmail and the only options in there are

DAEMON=no
QUEUE=1h

So if you want sendmail to be running all the time, you would set DAEMON=true, whereas if you only want sendmail to run when somebody tries to connect then you leave it as 'no', and configure xinetd appropriately.

And please not that the options in this file do not specify which interface sendmail listens on; that is specified in sendmail.{cf,mc} and submit.{cf,mc} as previously stated.


All times are GMT -5. The time now is 02:21 AM.