Slackware This Forum is for the discussion of Slackware Linux.
|
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
07-10-2004, 10:16 AM
|
#1
|
|
Member
Registered: Jun 2003
Location: Cleveburg, OH
Distribution: mostly Fedora
Posts: 154
Rep:
|
sendmail on 127.0.0.1 only
hello all!
i want to configure sendmail on slackware 10.0 to only listen on the loopback address. right now, netstat -lpn returns (among other things):
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 1352/sendmail: acce
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 1352/sendmail: acce
i need senmail to listen on port 25 locally, but it shouldn't receive mail from outside. normally i install qmail, but this is my friend's box and he doesn't want it.
i have never understood sendmail. i've managed mail servers for 6 years, but have never used it. sendmail just makes no sense... i've done some searching on the web, but nothing i've found seems to work, such as putting DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA') in sendmail-slackware.mc and recompiling.
thanks!
-eric
|
|
|
|
07-11-2004, 01:39 AM
|
#2
|
|
Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870
|
almost everything i found on google related to your question pretty much sounds like this:
(from http://www.deer-run.com/~hal/sysadmin/sendmail2.html )
Quote:
The way to configure Sendmail to listen on a specific address and port number is with the DaemonPortOptions in the sendmail.cf file:
# SMTP daemon options
o DaemonPortOptions=Addr=127.0.0.1,Port=smtp,Name=MTA
The configuration line you see here forces Sendmail to listen on the smtp port (usually 25/tcp as defined in /etc/services) on the loopback interface (address 127.0.0.1).
If you prefer, you may also set this option in your m4 macro configuration file. If you are using Sendmail v8.11 or later, then use the following configuration directive:
DAEMON_OPTIONS(`Addr=127.0.0.1,Port=smtp,Name=MTA')
For versions prior to v8.11, you use:
define(`confDAEMON_OPTIONS',`Addr=127.0.0.1,Port=smtp,Name=MTA')
In either case, the sendmail.cf file you generate should have DaemonPortOptions set appropriately.
|
this sounds like it's exactly what you did... you're using sendmail 8.12.11, right (slack 10)???
maybe it's not a sendmail issue???
i'm not sure... anyways, i just wanted to contribute my two cents...
good luck...
|
|
|
|
07-11-2004, 04:13 AM
|
#3
|
|
Member
Registered: Mar 2004
Posts: 519
Rep:
|
@whysyn
Since I have no experience of mail servers and you clearly have waaaay more than me :), do you think you can explain this to me?
If you disable external listening of port 25, doesn't that mean people can't e-mail you?
If I mailed your address, wouldn't I look up your domain, then connect to your port 25, which would then e-mail it to you? Or have I got something wrong :)?
Like I said, I am completely new to this sort of thing and have done very little research, I always thought you had to allow external clients to connect to port 25 but only allow them to e-mail your domain?
If you can explain that to me, that'd be great :)
Steve
|
|
|
|
07-11-2004, 04:42 AM
|
#4
|
|
Senior Member
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307
Rep:
|
Your best solution would be to block outside traffic to your port 25 using iptables.
Even if you need customized access (in the future), iptables should be the "gatekeeper".
|
|
|
|
07-11-2004, 07:00 AM
|
#5
|
|
Member
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 741
Rep:
|
I did this. It was a while back so I hope I get it right.
I suspect that you are already firewalled, but want to clean up at the source, not just rely on the 'gatekeeper'?
The critical file in all this is /etc/mail/sendmail.cf but you cannot modify this file directly, you have to use m4, so make sure m4 is installed, it is currently m4-1.4.1-i486-1.
sendmail-slackware.mc will be the template which is copied to config.mc which in turn is compiled to generate a new /etc/mail/sendmail.cf!
back up /usr/share/sendmail/cf/cf/sendmail-slackware.mc
then edit it:
dnl# This is the default sendmail .mc file for Slackware. To generate
dnl# the sendmail.cf file from this (perhaps after making some changes),
dnl# use the m4 files in /usr/share/sendmail/cf like this:
dnl#
dnl# cp sendmail-slackware.mc /usr/share/sendmail/cf/config.mc
dnl# cd /usr/share/sendmail/cf
dnl# sh Build config.cf
dnl#
dnl# You may then install the resulting .cf file:
dnl# cp config.cf /etc/mail/sendmail.cf
dnl#
include(`../m4/cf.m4')
VERSIONID(`default setup for Slackware Linux')dnl
OSTYPE(`linux')dnl
dnl# These settings help protect against people verifying email addresses
dnl# at your site in order to send you email that you probably don't want:
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
dnl# Uncomment the line below to send outgoing mail through an external server:
dnl define(`SMART_HOST',`mailserver.example.com')
dnl# No timeout for ident:
define(`confTO_IDENT', `0')dnl
dnl# Enable the line below to use smrsh to restrict what sendmail can run:
dnl FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
dnl# See the README in /usr/share/sendmail/cf for a ton of information on
dnl# how these options work:
FEATURE(`use_cw_file')dnl
FEATURE(`use_ct_file')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access')dnl
FEATURE(`blacklist_recipients')dnl
FEATURE(`local_procmail',`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`always_add_domain')dnl
FEATURE(`redirect')dnl
dnl# Toby starts here
dnl Don't create a default MSA configuration
FEATURE(`no_default_msa')dnl
dnl Limit the MSA to the loopback address
DAEMON_OPTIONS(`Name=MSA, Port=587, Addr=127.0.0.1, M=E')dnl
dnl Limit the MTA to the 127.0.0.1 interface
DAEMON_OPTIONS(`Name=MTA, Addr=127.0.0.1')dnl
dnl#Toby ends here
dnl# Turn this feature on if you don't always have DNS, or enjoy junk mail:
dnl FEATURE(`accept_unresolvable_domains')dnl
EXPOSED_USER(`root')dnl
dnl# Also accept mail for localhost.localdomain:
LOCAL_DOMAIN(`localhost.localdomain')dnl
MAILER(local)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
see the new lines between dnl# Toby starts here - dnl#Toby ends here ??
now if you want you can keep an eye out for errors, open up a console and type
tail -f /var/log/maillog
then
cd /usr/share/sendmail/cf/cf
cp sendmail-slackware.mc config.mc
m4 /usr/share/sendmail/cf/m4/cf.m4 config.mc > /etc/mail/sendmail.cf
restart Sendmail with the command:
/etc/rc.d/rc.sendmail restart
if that went ok, you can do some checks:
root@darkstar:~# netstat -an | grep :25 | grep tcp
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
or
root@darkstar:~# lsof -i
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
dhcpcd 835 root 4u IPv4 2374 UDP *:bootpc
cupsd 2399 root 0u IPv4 4391 TCP localhost:631 (LISTEN)
sendmail 2416 root 3u IPv4 4406 TCP localhost:submission (LISTEN)
sendmail 2416 root 5u IPv4 4407 TCP localhost:smtp (LISTEN)
privoxy 2489 privoxy 3u IPv4 4619 TCP localhost:8118 (LISTEN)
privoxy 2677 privoxy 3u IPv4 4619 TCP localhost:8118 (LISTEN)
root@darkstar:~#
as you can see I did a similar mod to cups :-)
tobyl
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 05:34 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|