If you have a static IP address, you should not need to adjust anything from the defaults. Set your host name to your assigned Internet name and sendmail will do the rest.
If you have a dynamically assigned IP number and use a
dialup PPP connection to the Internet, you will probably have a
mailbox on your ISPs mail server. Let's assume your ISP's domain
is example.net
, and that your
user name is user
, you have called your
machine bsd.home
, and your ISP has
told you that you may use relay.example.net
as a mail relay.
In order to retrieve mail from your mailbox, you must
install a retrieval agent. The
fetchmail utility is a good choice as
it supports many different protocols. This program is available
as a package or from the Ports Collection (mail/fetchmail
). Usually, your ISP will
provide POP. If you are using user PPP, you can
automatically fetch your mail when an Internet connection is
established with the following entry in
/etc/ppp/ppp.linkup
:
If you are using sendmail (as
shown below) to deliver mail to non-local accounts, you probably
want to have sendmail process your
mailqueue as soon as your Internet connection is established.
To do this, put this command after the
fetchmail
command in
/etc/ppp/ppp.linkup
:
Assume that you have an account for
user
on bsd.home
. In the home directory of
user
on bsd.home
, create a
.fetchmailrc
file:
This file should not be readable by anyone except
user
as it contains the password
MySecret
.
In order to send mail with the correct
from:
header, you must tell
sendmail to use
<user@example.net>
rather than
<user@bsd.home>
. You may also wish to tell
sendmail to send all mail via relay.example.net
, allowing quicker mail
transmission.
The following .mc
file should
suffice:
Refer to the previous section for details of how to turn
this .mc
file into a
sendmail.cf
file. Also, do not forget to
restart sendmail after updating
sendmail.cf
.
本文及其他文件,可由此下載: ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/。
若有 FreeBSD 方面疑問,請先閱讀
FreeBSD 相關文件,如不能解決的話,再洽詢
<questions@FreeBSD.org>。
關於本文件的問題,請洽詢
<doc@FreeBSD.org>。