Sendmail configuration...

Hi people,

I need to sort out sendmail on my network server.  It needs to immediately deliver local mail, queue outgoing mail and rewrite headers on outgoing mail.  Also, it must relay mail from PCs on my subnet (to either local users or put in in the outgoing queue).  So far, I have made it do all this except relay mail from other machines on the network.

I've been configuring it with a .mc file and generating the cf file from that.  What do I need to add to the .mc file to allow it to relay stuff on the local subnet only.  (I don't want other people using m box as a mail relay when I'm online.)

Paul
LVL 1
paulmitchAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gunny051499Commented:
the following works great for me (just insert the ruleset in sendmail.cf at the right location):

######################################################################
###  check_relay -- check hostname/address on SMTP startup
######################################################################

F{LocalIP}      /etc/trustedmailclasses

Scheck_rcpt
# get client addr
R$+                     $: $(dequote "" $&{client_addr} $) $| $1
R0 $| $*                $@ OK           permit local user

# check client IP against LocalIP
R$={LocalIP}$* $| $*    $@ OK           permit reg. dom. user

# not local, check rcpt
R$* $| $*               $: $>3 $2

# remove local part, maybe repeatedly
R$+                     $: $>removelocal $1

# still something left?
R$*<@$+>$*              $#error $@ 5.7.1 $: 550 we do not relay

Sremovelocal
R$*<@$=w.>$*            $: $>removelocal $>3 $1 $3
R$*<@$*>$*              $@ $1<@$2>$3

# dequote local part
R$-                     $: $>3 $(dequote $1 $)
R$*<@$*>$*              $: $>removelocal $1<@$2>$3      





-----
afterwards create a file called /etc/trustedmailclasses and insert IP-domains or IP-addresses as you wish:

10
192.168.1.1

and restart sendmail. now just hosts from 10.*.*.* (the free A-class network) and from 192.168.1.1 (a host out of the free B-class network) to use smtp services on your host.
0
paulmitchAuthor Commented:
Gunny,

Sorry it took me so long to try your solution - but I get lots of errors when I start sendmail.  It tells me that there are unknown configuration lines in sendmail.cf and they are the ones you suggested.  I'm running the version of sendmail with redhat 6.0 (8.9.0 I think)

Paul
0
gunny051499Commented:
mumble. should work anyway...

try searching for "relay +sendmail +domain" in altavista... you will get lots of links. also on www.sendmail.org there is a link "anti-relaying in sendmail 8.9" on the main-page.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

vxCommented:
Locate an FR rule in sendmail.cf if it isn't there, add the following:

FR-o /etc/mail/relay-domains

obviously, this depends on where you want to store the file.

/etc/mail/relay-domains:
insert all names here from which you want to relay mail, ie.

experts-exchange.com
www.experts-exchange.com

etc.
0
nirsimCommented:
Hi Paul,

  Tell me something, do you like to work too hard ? cause editing the sendmail.cf file manually is a drag, and can cause problems. I will presume that you are running RH6 or RH5.2, for both packages you have a program called 'mailconf'.
That program will enable you to accomplish all that you need, I know it can be done, cause I've done it myself.
  You must remember, that this program is suited to work on the sendmail installed with the package, not and external sendmail or other daemons, such as qmail.

Regards,
  Nir Simionovich
  Linux-IL Member
  Artnet Experts Ltd.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
paulmitchAuthor Commented:
Cheers nirsim.  Sorry it took me so long to get back to you.  That was very easy!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.