Re: [exim] trying to block non-special case addresses

Top Page
Delete this message
Reply to this message
Author: Terry Calie
Date:  
To: Exim-users
Subject: Re: [exim] trying to block non-special case addresses
Terry Calie wrote:
> I would like to be able to accept my defined email addresses as well as
> certain addresses I make-up on the fly. The addresses I make up on the
> fly are something like "bestbuycom@???" when I order something
> from their site. (It allows me to track where spam comes from and eaily
> block the one that starts getting spam later).
>
> my server has a virtual /etc/shadow passwd file for each site. so I can
> find the virtual usernames there. Then I just need to check if the
> email address ends in "com@???". If neither matches, I want to
> reject the email.
>
> During my ACL, I have the following to force verification:
> require verify = recipient
>
> Then in my routers, I've tried defining the following router which
> doesn't seem to decline anything (i'm looking to decline an address like
> "akfdjlkf@???" but allow virtual addresses like
> "terry@???" and allow my dynamic addresses ending in
> "com@???").
>
>
>
> Am I doing something that's always returning true?
>
> Thanks for any help.
> tc
>
>
>
>
> ==========================================
>
> virtual_aliases_local_and_com:
>    driver = redirect
>    !condition = ${\
>                        if or{\

>
> {lookup{$local_part}lsearch{/home/mysitedir/etc/mysite.com/shadow}}\
>                          {  match{$local_part}{.*com\$}   }\
>                        }\
>                  }
>    allow_fail
>    data = :fail: $local_part email address at this $domain was not found
>    verify_only

>
>
>
>



wow! it only took me 13 hours, but I figured it out:


virtual_aliases_local_and_com:
   driver = redirect
   condition = ${if and {\
                           {exists{/home/${lookup{$domain}lsearch* 
{/etc/userdomains}{$value}}/etc/$domain/shadow}}\
                           {\
                               !or {\
                                     {\
                                               match\
                                                   {\
                                                     ${\


lookup{$local_part}lsearch{/home/${lookup{$domain}lsearch* 
{/etc/userdomains}{$value}}/etc/$domain/shadow}\
                                                       }\
                                                   }\
                                                   {\N.*\d.*\N}\
                                     }\
                                     {\
                                               match\
                                                   {$local_part}\
                                                   {\N.*com$\N}\
                                     }\
                                 }\
                           }\
                     }\
               }
   allow_fail
   data = :fail: $local_part email address at this $domain was not found
   verify_only