Thanks all for the help. I decided instead to just replace all
instances of my internal domain using the following on my gateway
server:
/^(.*?)internal\.domain\.com(.*?)/ REPLACE ${1}pretend_name.domain.com${2}
This is because it wasn't modifying the Resent-Message-Id headers.
And on my internal server I just reverse the process. It doesn't seem
to work on lines containing multiple references to my internal server,
but that doesn't really affect me as I remove the received lines
altogether when it crosses my gateway.
Anyway, thanks again for the help!