My understanding is that this is not technically feasible in some scenarios. Especially the one where the sender has SPF and DMARC, but not DKIM. In that case you can't keep the envelope sender address (SMTP MAIL FROM) as is when forwarding because that would fail SPF at the recipient. But if you rewrite the envelope sender address, then that will fail DMARC at the recipient (due to the SPF Authenticated Identifier being out of alignment with the header From, see RFC 7489). So no matter what you do, the message will fail validation at the recipient. I guess you could change the From header to bring it back into alignment, and that would work because DKIM is not being used, but now the recipient end user will see an incorrect sender address…
If you managed to solve this problem then I'd be really curious to know how!