MegaBrutal:
> Hello,
>
> If I have a virtual alias map like this:
>
> @domain.tld [email protected] [email protected]
>
> 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 [email protected] receives an e-mail, I
> want it to be delivered to 3 addresses: [email protected],
> [email protected], and [email protected] 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 [email protected]
> [email protected] $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