This is how it was set up before:
Website email it goes from local host to the mail server. Then mail server relays to mailgun. In the process, mailgun strips the server ip and send the email to the end user
If can do this, bid on it!!
I have 16 years of experience in Web Hosting, server administration and php programming See my previous works at https://www.freelancer.com/u/Netfreehost Message me, let's discuss the project.