Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Sendmail configuration...

Posted on 1999-07-20
6
Medium Priority
?
304 Views
Last Modified: 2013-12-15
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
Comment
Question by:paulmitch
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 4

Expert Comment

by:gunny051499
ID: 1629813
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
 
LVL 1

Author Comment

by:paulmitch
ID: 1629814
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
 
LVL 4

Expert Comment

by:gunny051499
ID: 1629815
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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 2

Expert Comment

by:vx
ID: 1629816
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
 
LVL 2

Accepted Solution

by:
nirsim earned 180 total points
ID: 1629817
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
 
LVL 1

Author Comment

by:paulmitch
ID: 1629818
Cheers nirsim.  Sorry it took me so long to get back to you.  That was very easy!
0

Featured Post

How to Create Failover DNS Record Sets in Route 53

Route 53 has the ability to easily configure DNS record sets specifically for failover scenarios. These failover record sets can be configured to failover to full-blown deployments in other regions or to a static HTML page that informs your customers of the issue.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question