[SOLVED] What is the correct way to forward mail?

I think I’ve figured this out! The solution to my specific question is to use Postfix’s generic maps to rewrite specific senders to another address.

First I had to add the generic map to the bottom of /etc/postfix/main.cf:

smtp_generic_maps = hash:/etc/postfix/generic

In my case, that meant creating the /etc/postfix/generic file with contents like:

external.sender@remote.server.com    me@mydomain.com
another.sender@somewhere.else.com    me@mydomain.com
somebody@mail.server.external.com    me@mydomain.com

Then I run postmap /etc/mail/generic and systemctl restart postfix and re-enabled all of my roundcube sieve filters. All of the forwarded mail from those specific addresses will have the headers rewritten to appear to come from me. Some quick testing indicates that this works!


Maybe your relay is the problem?

Absolutely, yes. If I weren’t using an SMTP relay, I wouldn’t have to play by anybody’s rules, but I host on digitalocean and I’ve grown tired of the constant fight to keep my IP able to send to massive providers like gmail, microsoft, etc. Using a relay essentially mitigates those problems for me.