Subject: Re: allowing only mail from same domain
To: David Wetzel <dave@turbocat.de>
From: Andrew Brown <atatat@atatdot.net>
List: netbsd-help
Date: 12/13/2001 15:19:50
>I get lots of spam from faked hotmail.com aol.com etc. But they come from hosts that do not match *hotmail.com etc.
>Is there an sendmail hack that enables me to specify a list of domains that are only acceptable when the mail actually comes from a host of that domain?
>
>I am running NetBSD 1.5.1.
that looks like sendmail 8.11.3, unless you've upgraded it. i think
that adding something like
LOCAL_CONFIG
C{foo}aol.com hotmail.com
Kstorage macro
LOCAL_RULESETS
SLocal_check_mail
R$* $: <$&{client_name}> $>Parse0 $>3 $1
R<$+> $+ <@ $+ .> <$1> $2 <@ $3>
R$* $: <> $1 $(storage {bar} $@ $)
R< > <$* $={foo}> $+ <@ $+> $: <H> <$1 $2> $3 <@ $4> $(storage {bar} $@ $2 $)
R<H> <$+> $+ <@ $* $&{bar}> OKSOFAR
R< > <$+> $+ <@ $* $={foo}> $#error $@ 5.7.1 $: "550 must come from a " $4 " host"
R<H> $* $#error $@ 5.7.1 $: "550 must send mail from @" $&{bar}
R$* $@
to your .mc file and rebuilding (and reinstalling) the .cf file ought
to do the trick. be careful of the tabs. restart sendmail after
this, of course.
after this, aol.com mail can only come from aol.com hosts, and aol.com
hosts can only deliver aol.com mail.
--
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org * "ah! i see you have the internet
twofsonet@graffiti.com (Andrew Brown) that goes *ping*!"
andrew@crossbar.com * "information is power -- share the wealth."