A couple of questions for you.
First, why are you trying to remove the Received headers from the messages? I strongly recommend against doing that. The result of doing that is that machines further down the line will not see the received lines, which may result in your messages getting flagged as spam if they're outbound. If they're inbound, it'll result in message headers being mangled and possibly cause the messages to be unviewable or at least make them untraceable.
I really don't recommend this action. Perhaps if you can share why you are trying to do this, we can help you find a better way to do it.
I want to remove the "Received: from internalserver" because the outside world will know the name of my internal servers. That's something I would like to avoid
Do you any other to get around this issue?