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 |
have u restarted sendmail?
|
yup...after everytime I made a change
|
Why do you want to change it to 0.0.0.0 ?
That is the usually the address of a network, not a host. |
it's only listening on the loopback...I need it to listen on all interfaces
|
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 |
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 |
So what happens when you
telnet non_loopback_ip 25 |
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) |
This is telnet response:
telnet: connect to address 192.168.1.140: Connection refused sendmail 23641 root 4u IPv4 55698 TCP localhost:smtp (LISTEN) |
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? |
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 |
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 |
thanks for the help, but the answer was actually in /etc/sysconfig/mail
for smtp to listen on remote addresses |
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. |