When using a static IP address, one should not need to adjust the default configuration. Set the hostname to the assigned Internet name and Sendmail will do the rest.
When using a dynamically assigned IP address and a dialup
PPP connection to the Internet, one usually has a mailbox on the
ISP's mail server. In this example, the
ISP's domain is example.net
, the user name is
user
, the hostname is bsd.home
, and the ISP
has allowed relay.example.net
as a mail relay.
In order to retrieve mail from the ISP's
mailbox, install a retrieval agent from the Ports Collection.
mail/fetchmail
is a good
choice as it supports many different protocols. Usually, the
ISP will provide POP.
When using user PPP, email can be
automatically fetched when an Internet connection is established
with the following entry in
/etc/ppp/ppp.linkup
:
When using Sendmail to deliver
mail to non-local accounts, configure
Sendmail to process the mail queue as
soon as the Internet connection is established. To do this, add
this line after the above fetchmail
entry in
/etc/ppp/ppp.linkup
:
In this example, there is an account for
user
on bsd.home
. In the home directory of
user
on bsd.home
, create a
.fetchmailrc
which contains this
line:
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, configure
Sendmail to use
<user@example.net>
rather than <user@bsd.home>
and 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 convert
this file into the
sendmail.cf
format. Do not forget to
restart Sendmail after updating
sendmail.cf
.
All FreeBSD documents are available for download at http://ftp.FreeBSD.org/pub/FreeBSD/doc/
Questions that are not answered by the
documentation may be
sent to <freebsd-questions@FreeBSD.org>.
Send questions about this document to <freebsd-doc@FreeBSD.org>.