When using Postfix virtual alias maps to forward email to another domain, is it possible to have Postfix re-write the sender address exclusively for forwards to avoid SPF rejection at the final destination.
i.e. If user1@ourdomain.com
has a forward configured to anotheruser@externaldomain.com
, we want Postfix (running at ourdomain.com
) to rewrite the sender address to user1@ourdomain.com
.
Currently email sent from source@randomdomain.com
to user1@ourdomain.com
will be forwarded to anotheruser@externaldomain.com
with the sender address staying as source@randomdomain.com
, which causes an SPF rejection.
I've found in other answers such as this one that this is possible with postsrsd, however installing new software on these hosts is likely not possible.
I was initially looking into sender canonical maps, however the Postfix documentation suggests that canonical maps are not used with virtual alias maps:
Postfix address rewriting documentation:
Addresses found in virtual alias maps ... are not subjected to canonical mapping, in order to avoid loops.
Is there another way to re-write the sender address which will work with virtual alias maps without installing something like postsrsd?