On Sun, Nov 23, 2008 at 12:15:43AM -0600, Ville Walveranta wrote:
> Couple of messages earlier in this thread I posted the following pcre
> smtpd_recipient_access table:
> 
> # reject domains that are served by Katharion
> # on the generic smtpd interface
> /(@virtualdomain1\.com|
>  @virtualdomain2\.com|
>  @virtualdomain3\.com|
>  @virtualdomain4\.com|
>  @virtualdomain5\.com)$/  REJECT
> 
> That was of wrong format. In case someone is reading this later in the
> archives, here's the corrected version:
> 
> /virtualdomain1\.com$/  REJECT
> /virtualdomain2\.com$/  REJECT
> /virtualdomain3\.com$/  REJECT
> /virtualdomain4\.com$/  REJECT
> /virtualdomain5\.com$/  REJECT
> 
> PCRE statements can't be broken on multiple lines, of course, so if
> there are many items on the list it's better to break up the boolean
> statement. Also, I had initially (though not in the earlier post)..

http://www.postfix.org/pcre_table.5.html

Sure you can do multi-line, have a look at option x.

/@(virtualdomain1\.com|
   virtualdomain2\.com|
   virtualdomain3\.com|
   virtualdomain4\.com|
   virtualdomain5\.com
  )$/x REJECT

It's also basic regexp that lots of alternations are much likely to be
faster than executing separate clauses. Especially if you use the @ as
starting point. You could even use perl Regexp::Assemble to create optimized
monsters. Of course all this is marginal if you don't have thousands of
domains and CDB would be much more efficient anyway.

Reply via email to