sendmail rules to protect internal aliases

Julian Field mailscanner at ecs.soton.ac.uk
Wed Jun 26 11:25:22 IST 2002


At 00:36 26/06/2002, you wrote:
>I hope one of you sendmail rule wizards can help me with this...

OT.

>We have several "internal" aliases that are really distribution list
>-- including one alias that goes to the whole company. Some
>(stinking) spammer has harvested or otherwise guessed what some of
>these aliases are. Now we are getting spam to the whole company
>through one email address.

We have a whole bunch of aliases ending in "-all" (and sub-aliases ending
in "-all-0" to "-all-9" which aren't accessible from the outside. As an
example, here's an extract from one of my sendmail.mc files.

# This defines the regular expression that we will match against
KIsEcsList2 regex -a at MATCH ^.*-all(-[0-9])?$

LOCAL_RULESETS
SLocal_check_rcpt
R$*                     $: $>3 $1               Focus on host
R$*                     $: $>"QualifyDomain" $1 Make fully-qualified
R$* <@ $* $m. > $*      $1 <@ *LOCAL* >         Is recipient an ECS address?
R$* <@ *LOCAL* > $*     $: $(IsEcsList2 $1 $) <@ *LOCAL* > $2   ECS list?
R at MATCH <@ *LOCAL* > $* $#error $@ 5.1.2 $: Please contact ECS Help Desk

# If address is unqualified, add *LOCAL* as the destination hostname.
SQualifyDomain
R$* < @ $* > $*         $@ $1 < @ $2 > $3       Already fully qualified
R$+                     $@ $1 < @ *LOCAL* >     Add local qualification

That should do the trick for you. Don't forget to separate the fields of
each line with tab characters, not spaces.
--
Julian Field                Teaching Systems Manager
jkf at ecs.soton.ac.uk         Dept. of Electronics & Computer Science
Tel. 023 8059 2817          University of Southampton
                             Southampton SO17 1BJ



More information about the MailScanner mailing list