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 mail(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:
#
cd /usr/ports/mail/ssmtp
#
make install replace clean
Once installed, mail/ssmtp can be
configured with
/usr/local/etc/ssmtp/ssmtp.conf
:
root=yourrealemail@example.com
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
mail.example.com
.
Some ISPs call this the “outgoing mail
server” or “SMTP server”.
Make sure to disable Sendmail, including the outgoing mail service. See 節 28.4.1, “關閉 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.
本文及其他文件,可由此下載: ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/。
若有 FreeBSD 方面疑問,請先閱讀
FreeBSD 相關文件,如不能解決的話,再洽詢
<questions@FreeBSD.org>。
關於本文件的問題,請洽詢
<doc@FreeBSD.org>。