On 16 October 2017 at 11:38, Matus UHLAR - fantomas <uh...@fantomas.sk>
wrote:

> On 15.10.17 16:52, Bill Shirley wrote:
>
>> /.*@mydomain.tld/ REJECT
>>>
>>
>> The leading .* is not needed.  You should escape the period before tld
>> (\.).  You can
>> also send a message:
>> /@.*example\.com$/        REJECT You are not me (40,000).
>> This works for me.  Note: I'm using pcre instead of regexp.
>>
>
> and this .* is dangerous. it denies subdomains as well as other domains
> ending as example.com - e.hg. myexample.com might be foreign domain but
> you
> will reject it.
>
> instead of regexp (or pcre) I recommend using simple checks like hash:
>
> example.com     REJECT Authentication needed for this domain.
>
> you can still use regular expressions afterwards.


This regex will not deny subdomains or other domains:

/@example\.com$/ REJECT

In general hash table​ is simpler (and faster) but OP is already using
regex table so this avoids having to amend main.cf and create and hash a
new file.

Reply via email to