Re: [exim] Host Pattern Matching

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Marc Perkel
Data:  
Para: exim-users@exim.org >> \"'exim-users@exim.org'\"
Assunto: Re: [exim] Host Pattern Matching


Andreas Pettersson wrote:
> Marc Perkel wrote:
>> can I do pattern matching on hosts like:
>>
>> hosts = *.yahoo.*
>>
>> The docs are a little fuzzy on this.
>>
>
> It looks pretty clear to me, if I'm not mistaken.
> "If a pattern starts with “*” the remainder of the item must match the
> end of the host name." ... "Other kinds of wildcarding require the use
> of a regular expression."
> http://www.exim.org/exim-html-current/doc/html/spec_html/ch10.html#SECThoslispatnam
>
>
> So the answer is to use a regexp instead.
> hosts = ^.*\.yahoo\.
>


Yeah - I actually did something trickier.

warn    message = X-Big-Host: $sender_host_name
    condition = ${if match 
{$sender_host_name}{^.*\.${sg{${sg{${sg{${readfile{/etc/exim/acllists/bighosts.txt}{|}}}{\\|+}{|}}}{#.*?\\|}{}}}{\\|\$}{}}\$}{yes}{no}}
    log_message = BigHost $sender_host_name


File looks like this:

allmail\.net
aol\..*
asiamail\.com
aussiemail\.com\.au
bestmail\.us