Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sendmail on freeBSD

Status
Not open for further replies.

weedom

Programmer
Jan 29, 2005
7
GB
I decided to branch out and try a different flavour of Linux, and plumped for BSD. Everything is OK except I can't get sendmail running... again.

I've done everything recommended in this thread:
but I still get connection refused when I try to access my server from my home PC.

Again, I've got a simple perl script which I can run to listen on port 25. So I stop sendmail, get this little script to run, and I connect fine. So, again, it's not a firewall issue.

With the freeBSD sendmail installation came a whole load of .cf files which I don't think I need/want. So I've tarred them up safely, then removed them. All that is in /etc/mail now, cf-wise, is sendmail.cf and submit.cf.

"netstat -an | grep 25" gives the following:

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

As well as following the advice given in the previous thread, I've added a line to sendmail.cf and submit.cf in SRelay_ok which says this:

R192.168.1.2 $@ RELAY originated locally
 
try [red]ipfw list[/red] maybe your firewall is blocking the port

if it doesn't work then you have to recompile the kernel with the firewall options


``The wise man doesn't give the right answers,
he poses the right questions.''
TIMTOWTDI
 
The netstat says exactly what the problem is. It's only listening on 127.0.0.1 instead of 0.0.0.0 (all interfaces). Change your sendmail.mc from:
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
to
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl
or
DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl

Then rebuild your sendmail.c4 with:
m4 < sendmail.mc > sendmail.cf

Then tell sendmail to reread the config file:
killall -HUP sendmail

Run your netstat command again and it should be listening to 0.0.0.0 instead of 127.0.0.1.

I think BSD's include a Makefile in /etc/mail so that you can simply do:
make sendmail.cf
make restart
and it will do the last 2 steps for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top