MegaBrutal:
> Hello,
> 
> If I have a virtual alias map like this:
> 
> @domain.tld        someaddr...@otherdomain.tld superaddr...@somedomain.tld
> 
> Then all e-mails to domain.tld will be forwarded to the two given
> addresses, right?
> 
> Fine. But then, I want those e-mails to be delivered to the original
> recipient too. For example, if s...@domain.tld receives an e-mail, I
> want it to be delivered to 3 addresses: someaddr...@otherdomain.tld,
> superaddr...@somedomain.tld, and s...@domain.tld itself. If I could
> add the address to the list, it would be fine, but... it's a variable.
> How can I substitute a variable there? Something like:
> 
> @domain.tld        someaddr...@otherdomain.tld
> superaddr...@somedomain.tld $originaladdress
> 
> But I don't know what can I supply to substitute the original address with.

Use a PCRE table, capture the original address with (), and 
place it in the expansion as $1:

/etc/postfix/virtual.pcre:
    /(.+@example\.com$) $1, addr, addr

/etc/postfix/main.cf:
    virtual_alias_maps = pcre:/etc/postfix/virtual.pcre, othermaps...

In the left-hand pattern, the '\' and '$' are required to avoid
false matches.

        Wietse

Reply via email to