Using a database in check_relay

Last Update 2003-02-22
Jan Krüger suggested to use a map lookup to list IP addresses in check_relay too. You need a patch for sendmail 8.8.5 to make this work (it's fixed in later versions).
# Database definition
Kjunk btree /etc/mail/junk
The map is the same as for check_mail and looks like the following:
D.X.Y.Z IP
C.X.Y IP
B.X IP
A IP
(full IP numbers, class C, B, or A nets)
SjunkIP
# lookup IP in database
# full IP address
R$-.$-.$-.$-	$: $(junk $1.$2.$3.$4 $)
# class C net
R$-.$-.$-.$-	$: $(junk $1.$2.$3 $: $1.$2.$3.$4 $)
# class B net
R$-.$-.$-.$-	$: $(junk $1.$2 $: $1.$2.$3.$4 $)
# class A net
R$-.$-.$-.$-	$: $(junk $1 $: $1.$2.$3.$4 $)

Scheck_relay
# check IP
R$+ $| $+	$: $1 $| $>junkIP $2
R$+ $| IP	$#error $@ 5.7.1 $: "no access from your IP"
# check hostname
R$+ $| $+	$: $>junk <@$1>
R$*<@$*JUNK>$*	$#error $@ 5.7.1 $: "no access from this host"
You also need the junk ruleset from check_mail . All of these rulesets are included in the check.tar file as HACKs for use in your .mc file.
[(links)] [Hints] [Avoiding UBE] [cf/README] [New]
Copyright © Claus Aßmann Please send comments to: <ca at sendmail.org>
Disclaimer: the information provided may be inaccurate or outdated or incomplete. Please contact me if you find an error.