From: mloiterman on
Using:
FreeBSD 5.4-RELEASE
Sendmail 8.13.3

I'm trying to setup my mail server, but sendmail is only listening on
the local interface.

I know this because:
1.
# grep sendmail_submit_enable /etc/defaults/rc.conf
sendmail_submit_enable="YES" # Start a localhost-only MTA for mail
submission

2.
# netstat -an | grep 25
tcp4 0 0 127.0.0.1.25 *.*
LISTEN

3.
I can do:
# telnet localhost 25
And sendmail answers correctly. But, if, from another machine within
my network:

# telnet 192.168.1.22 25
I get a connection refused. Additionally, the sendmail logs show
nothing of the connection attempt.

How can I get it to listen on all interfaces?

When I put any of the following combinations in rc.conf:

sendmail_enable="YES"
sendmail_submit_enable="YES"

sendmail_enable="YES"
sendmail_submit_enable="NO"

sendmail_enable="YES"

I get the following errors in my messages.log when I start sendmail:

Sep 20 11:09:40 eisenhower sm-mta[2461]: starting daemon (8.13.3):
SMTP+queueing(a)00:30:00
Sep 20 11:09:40 eisenhower sm-mta[2461]: NOQUEUE: SYSERR(root):
opendaemonsocket: daemon MTA: cannot bind: Address already in use
Sep 20 11:09:40 eisenhower sm-mta[2461]: daemon MTA: problem creating
SMTP socket
Sep 20 11:09:40 eisenhower sm-msp-queue[2464]: starting daemon
(8.13.3): queueing(a)00:30:00
Sep 20 11:09:45 eisenhower sm-mta[2461]: NOQUEUE: SYSERR(root):
opendaemonsocket: daemon MTA: cannot bind: Address already in use
Sep 20 11:09:45 eisenhower sm-mta[2461]: daemon MTA: problem creating
SMTP socket
Sep 20 11:09:50 eisenhower sm-mta[2461]: NOQUEUE: SYSERR(root):
opendaemonsocket: daemon MTA: cannot bind: Address already in use
Sep 20 11:09:50 eisenhower sm-mta[2461]: daemon MTA: problem creating
SMTP socket
Sep 20 11:09:55 eisenhower sm-mta[2461]: NOQUEUE: SYSERR(root):
opendaemonsocket: daemon MTA: cannot bind: Address already in use
Sep 20 11:09:55 eisenhower sm-mta[2461]: daemon MTA: problem creating
SMTP socket
Sep 20 11:10:00 eisenhower sm-mta[2461]: NOQUEUE: SYSERR(root):
opendaemonsocket: daemon MTA: cannot bind: Address already in use
Sep 20 11:10:00 eisenhower sm-mta[2461]: daemon MTA: problem creating
SMTP socket

Here's are more troubleshooting steps I did:

1. Killed all sendmail processes
# killall -9 sendmail
#

2. Wiped out all custom sendmail config files and created fresh clean
standard ones.
# rm hostname.*
# make all

2. Listed everything before starting up sendmail
# netstat -naf inet
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address
(state)
tcp4 0 0 192.168.1.22.22 192.168.1.3.4154
ESTABLISHED
tcp4 0 0 *.993 *.*
LISTEN
tcp4 0 0 *.143 *.*
LISTEN
tcp4 0 0 *.995 *.*
LISTEN
tcp4 0 0 *.110 *.*
LISTEN
tcp4 0 0 *.139 *.*
LISTEN
tcp4 0 0 127.0.0.1.783 *.*
LISTEN
tcp4 0 0 *.3306 *.*
LISTEN
tcp46 0 0 *.80 *.*
LISTEN
tcp4 0 0 *.22 *.*
LISTEN
udp4 0 0 192.168.1.22.138 *.*
udp4 0 0 192.168.1.22.137 *.*
udp4 0 0 *.138 *.*
udp4 0 0 *.137 *.*
udp4 0 0 127.0.0.1.123 *.*
udp4 0 0 192.168.1.22.123 *.*
udp4 0 0 *.123 *.*
udp4 0 0 *.514 *.*

I don't see anything that should conflict. Do you?


3. Started sendmail
# cd /etc/mail
# make start

4. Listed everything after starting sendmail
# netstat -naf inet
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address
(state)
tcp4 0 0 127.0.0.1.62121 127.0.0.1.25
SYN_SENT
tcp4 0 0 *.25 *.*
CLOSED
tcp4 0 0 192.168.1.22.22 192.168.1.3.4154
ESTABLISHED
tcp4 0 0 *.993 *.*
LISTEN
tcp4 0 0 *.143 *.*
LISTEN
tcp4 0 0 *.995 *.*
LISTEN
tcp4 0 0 *.110 *.*
LISTEN
tcp4 0 0 *.139 *.*
LISTEN
tcp4 0 0 127.0.0.1.783 *.*
LISTEN
tcp4 0 0 *.3306 *.*
LISTEN
tcp46 0 0 *.80 *.*
LISTEN
tcp4 0 0 *.22 *.*
LISTEN
udp4 0 0 192.168.1.22.138 *.*
udp4 0 0 192.168.1.22.137 *.*
udp4 0 0 *.138 *.*
udp4 0 0 *.137 *.*
udp4 0 0 127.0.0.1.123 *.*
udp4 0 0 192.168.1.22.123 *.*
udp4 0 0 *.123 *.*
udp4 0 0 *.514 *.*

5. Checked /var/log/maillog to find the same errors:
# tail -f /var/log/maillog
Sep 20 11:09:40 eisenhower sm-mta[2461]: starting daemon (8.13.3):
SMTP+queueing(a)00:30:00
Sep 20 11:09:40 eisenhower sm-mta[2461]: NOQUEUE: SYSERR(root):
opendaemonsocket: daemon MTA: cannot bind: Address already in use
Sep 20 11:09:40 eisenhower sm-mta[2461]: daemon MTA: problem creating
SMTP socket
Sep 20 11:09:40 eisenhower sm-msp-queue[2464]: starting daemon
(8.13.3): queueing(a)00:30:00
Sep 20 11:09:45 eisenhower sm-mta[2461]: NOQUEUE: SYSERR(root):
opendaemonsocket: daemon MTA: cannot bind: Address already in use
Sep 20 11:09:45 eisenhower sm-mta[2461]: daemon MTA: problem creating
SMTP socket
Sep 20 11:09:50 eisenhower sm-mta[2461]: NOQUEUE: SYSERR(root):
opendaemonsocket: daemon MTA: cannot bind: Address already in use
Sep 20 11:09:50 eisenhower sm-mta[2461]: daemon MTA: problem creating
SMTP socket
Sep 20 11:09:55 eisenhower sm-mta[2461]: NOQUEUE: SYSERR(root):
opendaemonsocket: daemon MTA: cannot bind: Address already in use
Sep 20 11:09:55 eisenhower sm-mta[2461]: daemon MTA: problem creating
SMTP socket
Sep 20 11:10:00 eisenhower sm-mta[2461]: NOQUEUE: SYSERR(root):
opendaemonsocket: daemon MTA: cannot bind: Address already in use
Sep 20 11:10:00 eisenhower sm-mta[2461]: daemon MTA: problem creating
SMTP socket

This is my hostname.mc file:
divert(0)
VERSIONID(`$FreeBSD: src/etc/sendmail/freebsd.mc,v 1.29 2003/12/24
21:15:09 gshapiro Exp $')
OSTYPE(freebsd5)
DOMAIN(generic)

FEATURE(access_db, `hash -o -T<TMPF> /etc/mail/access')
FEATURE(blacklist_recipients)
FEATURE(local_lmtp)
FEATURE(mailertable, `hash -o /etc/mail/mailertable')
FEATURE(virtusertable, `hash -o /etc/mail/virtusertable')

dnl Uncomment to allow relaying based on your MX records.
dnl NOTE: This can allow sites to use your server as a backup MX
without
dnl your permission.
dnl FEATURE(relay_based_on_MX)

dnl DNS based black hole lists
dnl --------------------------------
dnl DNS based black hole lists come and go on a regular basis
dnl so this file will not serve as a database of the available
servers.
dnl For that, visit
dnl
http://directory.google.com/Top/Computers/Internet/Abuse/Spam/Blacklists/


dnl Uncomment to activate Realtime Blackhole List
dnl information available at http://www.mail-abuse.com/
dnl NOTE: This is a subscription service as of July 31, 2001
dnl FEATURE(dnsbl)
dnl Alternatively, you can provide your own server and rejection
message:
dnl FEATURE(dnsbl, `blackholes.mail-abuse.org', `"550 Mail from "
$&{client_addr} " rejected, see http://mail-abuse.org/cgi-bin/lookup?"
$&{client_addr}')

dnl Dialup users should uncomment and define this appropriately
dnl define(`SMART_HOST', `your.isp.mail.server')

dnl Uncomment the first line to change the location of the default
dnl /etc/mail/local-host-names and comment out the second line.
dnl define(`confCW_FILE', `-o /etc/mail/sendmail.cw')
define(`confCW_FILE', `-o /etc/mail/local-host-names')

dnl Enable for both IPv4 and IPv6 (optional)
DAEMON_OPTIONS(`Name=IPv4, Family=inet')
DAEMON_OPTIONS(`Name=IPv6, Family=inet6, Modifiers=O')

define(`confBIND_OPTS', `WorkAroundBrokenAAAA')
define(`confNO_RCPT_ACTION', `add-to-undisclosed')
define(`confPRIVACY_FLAGS', `authwarnings,noexpn,novrfy')
MAILER(local)
MAILER(smtp)

I posted to freebsd.questions mailing list, but got very little help
there.

From: mloiterman on
Anyone?

From: Andrzej Adam Filip on
"mloiterman" <mike(a)ascendency.net> writes:

> Anyone?

Take a look at http://www.sendmail.org/faq/section5.html#5.3.1.3

May be other have decided to follow Red Hat example.

--
Andrzej [en:Andrew] Adam Filip anfi(a)priv.onet.pl anfi(a)xl.wp.pl
http://www.sendmail.org/faq/ http://anfi.homeunix.net/sendmail/
From: mloiterman on
> use # cd /etc/mail && make stop
Sometimes that doesn't stop all the processes.

> (Make) target all - Build cf, maps and aliases
'make all' is the correct command and the command I issued. I don't
know what you're trying to tell me here.

> Uhh, cd _before_ rm hostname.*
You think? I did that, but you're too busy trying to correct my
commands instead of giving useful advice to have noticed.

> FIRST # make install
You think? I did that, but you're too busy trying to correct my
commands instead of giving useful advice to have noticed.

>From the orginal post:
# killall -9 sendmail
<snip>
# rm hostname.*
# make all
<snip>
# cd /etc/mail (just to be sure)
# make start

> Because they ARE the same errors! (Time [PID])
Thanks for pointing out the obvious. Yes, they're the same errors.
Would you like new ones with different time stamps and PIDs?

> I do miss an entree about starting the server though.
make start

> Get rid of the -o (and get a warning when a file is missing)
And you're telling me this because...? I don't have any missing files.

From: mloiterman on
I thought of that, but that line doesn't exist in my .mc file. Thanks
though.