Date: Tue, 20 Apr 1999 11:52:13 GMT From: "James C. Durham" <durham@w2xo.pgh.pa.us> To: freebsd-questions@freebsd.org Subject: sendmail check_rcpt fix Message-ID: <199904201152.LAA20066@w2xo.pgh.pa.us>
next in thread | raw e-mail | index | archive | help
Maybe this has been posted, but I didn't see it and
it drove me nuts for a while.
The "check_rcpt" ruleset as shipped with the
sendmail.cf file that comes with the 3.1-RELEASE
appears to be broken. It does not allow machines
on a local LAN with unregistered IP addresses to
relay mail through a server running 3.1-RELEASE with
the stock sendmail.cf file. The mail is rejected with
"relaying denied" from the check_rcpt ruleset.
The fix I applied was to install a suggested check_rcpt
ruleset from sendmail.org and create two new files in
/etc/mail, "/etc/mail/LocalIP" and "/etc/mail/RelayTo".
The first contains the unregistered IP addresses of
machines on you LAN behind a firewall that are allowed
to relay mail. The second is just null, but must exist.
The ruleset is:
Scheck_rcpt
# first: get client addr
R$+ $: $(dequote "" $&{client_addr} $) $| $1
R0 $| $* $@ ok no client addr: directly invoked
R$={LocalIP}$* $| $* $@ ok from here
# 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
# remove RelayTo part (maybe repeatedly)
# R$*<@$*$={RelayTo}.>$* $>3 $1 $4
R$*<@$=w.>$* $: $>removelocal $>3 $1 $3
R$*<@$*>$* $@ $1<@$2>$3
# dequote local part
R$- $: $>3 $(dequote $1 $)
R$*<@$*>$* $: $>removelocal $1<@$2>$3
##################################################
you must also put definitions for the two files near the
beginning of the sendmail.cf file. ie;
F{LocalIP} /etc/mail/LocalIP
F{RelayTo} /etc/mail/RelayTo
Hope this helps someone with the same problem.
regards,
Jim Durham
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199904201152.LAA20066>
