What is the best MTA setup for a home/laptop computer (*not* server)?

What is a good MTA (e.g. Postfix or something else) setup for a home computer behind a NAT, or a laptop that is not always online?

I've read a lot of Postfix tutorials on how to set it up this way or that, but they are usually geared towards computers that are servers ie they

  • have a static IP
  • have a domain name
  • are always connected to the same network

My requirements are, I guess:

  • Ability to redirect mail for local users to another server of my choosing.
  • No listening for incoming SMTP connections - outgoing only
  • Ability to route outgoing mail via an external SMTP server with authentication (and perhaps encryption)

If not Postfix, I need an MTA which can queue up mails in case it temporarily has no internet connection.


Solution 1:

  • Postfix
  • exim

I used to use Postfix on my PC, and it worked really fine. The only downside to it is that Postfix always runs a few daemons (master, qmgr, etc), and with exim I could reduce that to a sendmail -q crontab entry.


For Postfix:

  • set relayhost
  • for SMTP TLS, smtp_tls_security_level=encrypt
  • for SMTP relay auth, smtp_sasl_auth_enable and smtp_sasl_password_maps
  • comment out smtp service in master.cf

For Exim:

  • add a gateway router (example)
  • comment out the dnslookup router
  • for SMTP TLS, add a new transport using smtp but with TLS enabled (docs)
  • stop the exim daemon (to disable listening for SMTP)
  • and add sendmail -q to root's cron (to flush queue every X minutes; normally the daemon would do this)

Solution 2:

If you have a gmail account, you should install postfix and configure it to use your gmail account as a relay.

E.g. http://www.marksanborn.net/linux/send-mail-postfix-through-gmails-smtp-on-a-ubuntu-lts-server/

The main issue with setting up postfix on a roaming machine (sounds like you're on a laptop) is that e-mail sent from domains without MX or PTR records is very likely to end up in the spam folder or not even get delivered at all.

By relaying your email through your gmail account, though, you make it much more likely to get your e-mail delivered.

BTW, what was your ultimate goal? Sounds like you are receiving mail on a local unix account (maybe from cron?) and want to get it forwarded to somewhere you'll actually read it. Correct?