Alex:
> I'm using postfix-2.10.3 on fedora20 and I don't understand how to use
> pcre. I've read the pcre man page, but it doesn't explain how it applies to
> using it with check_helo_access and a pcre table.

Indeed. It explains how the PCRE lookup table works, not things like
header_checks or access maps that might use PCRE.

> For a regular postmap hash, I would do the following for a host without a
> valid forward DNS entry (and the complementing reverse):
> 
> host.example.com                OK
> 192.168.0.1                          OK

Correct.

> For pcre, I wanted to be sure the following would be acceptable:
> 
> /^host\.example\.com$/          OK
> /192.168.0.1/                         OK
> 
> It's both the left and right side I don't understand. The check_helo_access
> section of postconf(5) seems to use "OK" and "REJECT" in the same way as
> other tables, but doesn't specifically define their usage.

With both tables, the left side is the thing that must match the
thing that you want to be matched (in this case the client name or
IP address).

With both tables, the right side is the lookup result when a match
is found.

Your hostname pattern looks OK, but you should also use ^, \. and $
in the IP address, because PCRE matches text and knows nothing
about IP addresses.

However you must be masochistic person if you want to replace
fixed-string hash lookups with PCRE pattern matching. PCRE is useful
when you to match more than fixed strings.

        Wietse

Reply via email to