Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there an easy way to install a MTA on Ubuntu and forward all email to a different remote email box? Only want to forward local email and looking for something dead simple. Thank you!


I see that ssmtp and nullmailer are suggested, but I need something (just a) little more clever. I have one machine ( where I want local mail to be delivered at and I want it delivered through direct connection to

So when I do mail root on it should get forward to Issue with nullmailer and ssmtp is that forwarding is done to but mail is delivered with a RCPT TO set to and I want the RCPT TO set to

Possible with a simple solution or do I need to digg into postfix or exim for this?

share|improve this question
up vote 3 down vote accepted

There's certainly no shortage of MTAs in Linux, nor in Ubuntu. As the most full-featured (and possibly overblown) solution, you can use postfix to relay emails to a provider - i.e. all the emails it receives will be sent via that SMTP server. Here is a tutorial with details for Google Mail.

A more lightweight, and more simple alternative is nullmailer, although I'm not sure if it is capable of using all the secure transport methods required for Google Mail.

Finally, the easiest solution seems to be ssmtp. The setup is described here.

share|improve this answer
Definetly nullmailer is the winner, the installer is asking for the minimal information and it just works after this. – sorin May 24 '12 at 9:27

It doesn't get much simpler than nullmailer Install nullmailer . Although the mail will have to be sent to real addresses as nullmailer only forwards to a smart MTA.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.