Forward port 25 through a remote server via ssh tunnel or iptables?

Hello Experts:

In this scenario lets pretend Postfix or another mail server is not available to relay email for me.

[server 1] <---> <dynamic IP address> <---> <internet> <---> <static ip address <---> [remote server] <internet> <---> <destination email server>

Issue: To save myself 100 dollars a month at home on static IP addresses (thanks comcast), I have setup my home network using static IP addresses. I have a remote VPS that I use that has static IPs and I use it as a router of sorts. It works GREAT for everything but for sending email. My email server is located behind my home network (server 1) and can receive email no problem, but sometimes when I send email I get a bounce back because I'm behind a dynamic IP address (some email servers reject this as possible spam).

I would like to know if there is an easy solution just using either IPTables forwarding, or SSH tunnles, or a mix?

It's easy for me to grab all traffic heading out with destination 25 and redirect it to any port on my remote VPS box, but I'm not sure how to get it to route through after that and be forwarded to the destination, such as mail.google.com or what-have-you?

Thanks for any help!

dr34m3r
LVL 1
dr34m3rsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

giltjrCommented:
What I would suggest is setup your SMTP server at your home as a relay only and have it forward everything to at SMTP server you run on your VPS box.  Have the VPS box deliver the e-mail to the destination.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dr34m3rsAuthor Commented:
That's exactly what I ended up doing. This is perfect and gives much more control once you figure out postfix. I read you can even strip headers to keep the "received from" in the headers clean...  great stuff!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.