There are many instances where one may only want to send mail through a relay. Some examples are:
The computer is a desktop machine that needs to use programs such as send-pr(1), using the ISP's mail relay.
The computer is a server that does not handle mail locally, but needs to pass off all mail to a relay for processing.
While any MTA is capable of filling this particular niche, it can be difficult to properly configure a full-featured MTA just to handle offloading mail. Programs such as Sendmail and Postfix are overkill for this use.
Additionally, a typical Internet access service agreement may forbid one from running a “mail server”.
The easiest way to fulfill those needs is to install the mail/ssmtp port:
make install replace clean
Once installed, mail/ssmtp can be
firstname.lastname@example.org mailhub=mail.example.com rewriteDomain=example.com hostname=_HOSTNAME_
Use the real email address for
root. Enter the
ISP's outgoing mail relay in place of
Some ISPs call this the “outgoing mail
server” or “SMTP server”.
Make sure to disable Sendmail, including the outgoing mail service. See Section27.4.1, “Disable Sendmail” for details.
mail/ssmtp has some other options
available. Refer to the examples in
/usr/local/etc/ssmtp or the manual page
of ssmtp for more information.
Setting up ssmtp in this manner allows any software on the computer that needs to send mail to function properly, while not violating the ISP's usage policy or allowing the computer to be hijacked for spamming.