Nullmailer, a developer's best friend
It is available on Debian/Ubuntu systems with sudo apt-get install nullmailer. The source and RPM is available on the homepage.
The apt/dpkg configuration will let you enter a smarthost to forward mail to which should look something like the line below (if you installed from source you can add the same details to /etc/nullmailer/remotes):
mail.server.com smtp --port=25 --user=me@host --pass=changemeThe --user and --pass flags are optional and are only required for authenticated SMTP connections.
It's one of those great pieces of software that you stumble upon by accident and fall in love with. I've also used it in production where webservers have been behind firewalls and it has never let me down.