Re: [exim] Blocking names in e-mailaddresses

Top Page
Delete this message
Reply to this message
Author: Jens Strohschnitter
Date:  
To: exim-users
Subject: Re: [exim] Blocking names in e-mailaddresses
> >> > I want to block Mails not by the email-address, but by the name in the field
> >> > "from:" such as "Doctor" <blabla(at)blablabla.net>.
> >> > So for example any mail that contains "doctor" in the from-field and with any
> >> > email-address should be rejected.
> >> > Is it possible ? And how can I add it to the global.system.filter ?
> >>
> >> I have done it in ACLs:
> >>
> >> Place in "acl_smtp_data" section:
> >>
> >> # blacklist -- $h_from
> >>
> >> deny    message = $acl_m1 "${address:$h_From:}"
> >>         set acl_m1 = ${lookup {${address:$h_From:}} \
> >>                      nwildlsearch{/path_to_blacklists/h_from} }
> >>         condition = ${if eq {$acl_m1} {} {no} {yes} }

> >>
> >> ... and the file "/path_to_blacklists/h_from" looks like:
> >>
> >> ...
> >> ^localpart@domain\.example$ : - locally blacklisted (header) address
> >
> > Hi
> >
> > I have replied to fast. I have added it to my exim.conf (exim 4.30) but
> > nothing will be blocked.
>
> Have you declared a "acl_smtp_data" section in your config?
>
> > What should be entered to the /path_to_blacklists/h_from ?
> > This should contain a list of names like doctor. For example the mailaddress
> >
> > "Doctor" blabla@???
>
> This complete string is not an email address, only the part
> "blabla@???" is one. Are you sure, you want to check any part of
> header "from:", not only the email address?
>
> If yes, then don't extract the email address from header, and let
> nwildlsearch compare file content against the whole header string:
>
> set acl_m1 = ${lookup {$h_From:} \
>              nwildlsearch{/path_to_blacklists/h_from} }

>
> > should be blocked. But only if "" contains doctor.
> > What do I have to add to the blacklist ?
>
> doctor : text you want to be reported along with the deny
>



Hi

I need the config for 4.20 and 4.30. With 4.20 the command nwildsearch
is not supported:

unknown lookuptype: "nwildsearch"

What should I use for 4.20 ? lsearch only, blocks any incomming mail :-(

--
Regards,

     Jens Strohschnitter


-------------------------------------
*!!!LINUX LINUX LINUX LINUX LINUX!!!*

* http://www.jens-strohschnitter.de *
-------------------------------------
Set the controls for 
         the heart of the sun
-------------------------------------