sSMTP
From DreamHost
sSMTP is a simple package that can stand in place of sendmail for simple situations. It works on several systems, including Linux, FreeBSD and Windows (within Cygwin).
As an example, you might want to use sSMTP in Cygwin on a Windows box instead of the larger Exim.
Other simple and light-weight MTAs include msmtp and dma.
Configuration
Set up your ssmtp.conf - located in /etc/ssmtp/ssmtp.conf (could differ, on FreeBSD prepend /usr/local):
MailHub=mail.yourdhdomain.com:465 # SMTP server hostname and port UseTLS=YES # Secure connection (SSL/TLS) FromLineOverride=YES # Force the From: line Hostname=yourdhdomain.com # The name of this host RewriteDomain=yourdhdomain.com # The host the mail appears to be coming from Root=postmaster # Redirect mail for root@ to postmaster@ AuthUser=user@yourdhdomain.com # Your DreamHost mail account AuthPass=password # The password for the mail account
You may then want to set up an alias in your shell environment, to map the command mail to ssmtp:
alias mail=ssmtp
Add this to your ~/.profile or .cshrc, depending on your personal shell preference.
Better yet, make /usr/bin/mail (or /usr/local/bin/mail) a symbolic link to the ssmtp executable.