Mail and the Web
Two services that a small machine often provides: a mail transfer
agent that delivers local mail, and a web server that serves a directory.
Both are NetBSD base services; Makronix ships the clients and the desktop
programs that read the results.
Mail
The base system's mail transfer agent is
Postfix. A desktop that only needs local
mail — the daily security report, cron's output, the messages of
the package tools — runs it with the default configuration and
reads the mail with mail or MCDE's
dtmail1:
# echo 'postfix=YES' >> /etc/rc.conf
# /etc/rc.d/postfix start
$ mail
/etc/postfix/main.cf is the configuration. A
machine that should accept mail from the network sets
inet_interfaces and a proper
myhostname, and needs a DNS name with an MX record.
That is a mail server, not a desktop; the NetBSD Guide's mail chapter
and the Postfix documentation describe the decisions, and the firewall
chapter describes the port that has to be opened.
Local mail is delivered to /var/mail/name.
If mail does not arrive, read /var/log/maillog;
Postfix writes there, and postfix check reports a
configuration that it cannot use.
A web server
The base system's HTTP server is
bozohttpd8,
installed as httpd. It serves one directory, which
is enough for a documentation page or a small site:
# echo 'httpd=YES' >> /etc/rc.conf
# echo 'httpd_flags="-b /var/www"' >> /etc/rc.conf
# /etc/rc.d/httpd start
$ curl http://localhost/
/var/www is the document root; the index file
is index.html. A server that needs CGI, PHP, TLS
or virtual hosts should use a package: nginx
or apache, with their own documentation and
their own service scripts.
TLS needs a certificate. For a public name, the certificate
authority's client (for example certbot)
obtains and renews it; for a name that only the local network uses, a
self-signed certificate is enough, and every client has to be told to
trust it. A certificate that has expired is the most common reason a
site that worked yesterday does not work today.
The desktop clients
Firefox reads the web, Thunderbird reads mail and news, and
dtmail reads local mail in the MCDE style. All three
are on the medium as packages; the installer can put them on the
machine, and pkg_add installs them later
(). Their settings belong to the user, not to
the system, and live under ~/.mozilla,
~/.thunderbird and ~/.dt.