As documented, Postfix does not allow regular expression substitutions
in virtual_mailbox_maps lookup results. That would give attackers
too much control over where mail will be delivered.

Why aren't you using Dovecot's mail delivery agent?

        Wietse

Brandon Metcalf:
> I believe this solution will result in email getting delivered to
> vhost/foo.org rather than vhost/<sub>.foo.org.  We need the latter.
> 
> On Thu, Nov 20, 2014 at 7:49 AM, Wietse Venema <wie...@porcupine.org> wrote:
> > Brandon Metcalf:
> >> We are looking for a way to accept email for all users where the
> >> address matches /bob@.*\.foo\.org/ without maintaining a list of all
> >> possible subdomains.  We use dovecot as our transport with postfix and
> >> deliver mail locally to /var/mail/vhosts/<subdomain>/bob/.  The
> >> username will always be the same.
> >>
> >> Any ideas?  Thanks.
> >
> > Use a virtual_alias_maps regular expression table.
> >
> >     /^bob@.*\.foo\.org$/        b...@foo.org
> >
> > To propagate the subdomain as an address extension:
> >
> >    /^bob@(.*).\foo\.org$/       bob+$1...@foo.org
> >
> > (this assumes recipient_delimiter=+; with Postfix 2.11 the
> > recipient_delimiter can specify a set, such as "+-").
> >
> >         Wietse
> 

Reply via email to