[exim] regex in an lsearch file?

Page principale
Supprimer ce message
Répondre à ce message
Auteur: William Deedes
Date:  
À: exim-users
Sujet: [exim] regex in an lsearch file?
Hi - newbie question, I'm afraid -

My virtual server has converted from sendmail to exim, and still uses
the sendmail-format virtusertable. I don't have root access, because of
the way that the server is configured, so I can only modify my
virtusertable and alias files. The virtusertable looks something like this:

xyz@??? local-account-a
foo@??? local-account-b
@anotherdomain.com local-account-c

Now, I've recently started getting a huge number of spams to arbitrary
numeric addresses at 'mydomain.com'. I'd like to bounce these from exim,
rather than getting them sent on to local users. Can I put the regex in
my virtusertable? ie. something like:

xyz@???    local-account-a
foo@???    local-account-b
[0-9]+@mydomain.com error:nouser
@anotherdomain.com  local-account-c


I've done some digging about in the manual, but I'm afraid that this is
going to be beyond me without a degree in manual reading. I have read
access to exim.conf, and the virtusertable processing is attached below.

Any advice very gratefully received.

Cheers -

Bill

----------------------------------------------------------

> virtusertable_user:
> debug_print = "R: virtusertable_user for $local_part@$domain"
> driver = redirect
> domains = +local_domains
> local_part_suffix = "+*"
> local_part_suffix_optional
> allow_fail
> allow_defer
> file_transport = address_file
>
>   # Check for specific address vut key, or failing that a whole domain vut key
>   condition = ${lookup{$local_part@$domain}  lsearch{/usr/local/etc/mail/virtusertable}\
>                       {yes}\
>                       {no}}

>
>   # Return the vut entry, substituting any 'percent one' local part placeholder
>   data = ${sg {${lookup{$local_part@$domain} lsearch{/usr/local/etc/mail/virtusertable}\
>                        {FAIL_NOUSER}\
>                        {}}\
>               }\ 
>               {\%1}\
>               {$local_part}\
>           }

>

...
> virtusertable_domain:
> debug_print = "R: virtusertable_domain for $local_part@$domain"
> driver = redirect
> domains = +local_domains
> allow_fail
> allow_defer
> file_transport = address_file
>
>   # Check for specific address vut key, or failing that a whole domain vut key
>   condition = ${lookup{@$domain}   lsearch{/usr/local/etc/mail/virtusertable}\
>                       {yes}\
>                       {no}}

>
>   # Return the vut entry, substituting any 'percent one' local part placeholder
>   data = ${sg {${lookup{\@$domain} lsearch{/usr/local/etc/mail/virtusertable}\
>                        {FAIL_NOUSER}\
>                        {}}\
>               }\ 
>               {\%1}\
>               {$local_part}\
>           }