On Thu, Jul 25, 2013 at 08:26:24PM +0200, Ralf Hildebrandt wrote:
> * Wietse Venema <wie...@porcupine.org>:
> > Fernando Gozalo:
> > > How can I deliver the messages to the mailbox of the sender 
> > > instead of the mailbox of the recipient?
> > 
> > /etc/postfix/main.cf:
> >     smtpd_sender_restrictions = pcre:/etc/postfix/sender_access
> > 
> > /etc/postfix/sender_access:
> >     /.+/    redirect $1
> 
> Doesn't this require ()?
> /(.+)/      redirect $1

I thought the same thing when I saw this, and I referred to the 
pcre_table(5) manual:
        Substitution of substrings from the matched expression
        into  the result string is possible using the conventional
        perl syntax ($1, $2, etc.); ...
Basically it says "see the Perl documentation for their syntax."

I lost interest at that point. :) But I got reinterested with your 
post, and made a simple test:

$ echo -e '/.+/ redirect $1\n/(.+)/ redirect $1' > pcre
$ /usr/sbin/postmap -q testing pcre:./pcre
postmap: warning: pcre map ./pcre, line 1: out of range replacement index "1": 
skipping this rule                       
redirect testing

> or are the () implied if there's only one match group

So no, apparently you are right. Or this might vary with different 
PCRE implementations?
-- 
  http://rob0.nodns4.us/ -- system administration and consulting
  Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:

Reply via email to