Noel Jones a écrit :
> mouss wrote:
>> Len Conrad a écrit :
>>> ... they work, and works for each different PCRE in the .class.
>>> The above is caught by:
>>>
>>> /[0-9]{1,3}(\.|\-)[0-9]{1,3}(\.|\-)[0-9]{1,3}(\.|\-)[0-9]{1,3}.*\[/
>>> client_filter.class
>>>
>>
>> remove the \[ part.
>>
>> and BTW, here is a shorter version:
>>
>> /(\d{1,3}[-\.]){3}\d{1,3}/ class_client_filter
>>
>>
>>
>>> ... but is not going to the restriction class as actual SMTP client.
>>>
>>
>
> After looking at my and mouss' advice, I realize the expressions we
> suggested will match _all_ clients since it matchs an IP address.
> Probably not what you intend.
>
> Here's what I use to match IP-containing hostnames, should work for you.
> /(\d{1,3}[-\.]){3}\d{1,3}[^.]+\.[^.]/ class_client_filter
> ie. there must be a dot somewhere after the IP-containing section.
>
good catch.
an alternative is to exclude IPs:
IF /^[\d\.]*$/
...
ENDIF