sendmail rules to protect internal aliases

Julian Field mailscanner at ecs.soton.ac.uk
Wed Jun 26 15:30:09 IST 2002


At 14:42 26/06/2002, you wrote:
> >
> > 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
> > 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
>
>Julian, did you really mean that you have the above rules in the
>sendmail.mc file or are they actually in the sendmail.cf file?

Okay, as they don't actually contain any m4 macro expansions (except the
LOCAL_RULESETS line) then they can be put in either. However, I would
strongly advise that you don't directly edit cf files. That's why they
created mc files, to make your life easier.

>   I didn't
>think you could put stuff like this in the sendmail.mc file and have it
>still compile.

Oh yes, no problem. The "compiling" process is just a macro pre-processor
that expands things like "FEATURE" and "HACK" and "LOCAL_RULESETS". It's
just the same as passing C source code through the C pre-processor: that
one understands things like "#include" and "#define".
--
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