[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 305
  • Last Modified:

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
0
paulmitch
Asked:
paulmitch
1 Solution
 
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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
 
paulmitchAuthor Commented:
Cheers nirsim.  Sorry it took me so long to get back to you.  That was very easy!
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now