Postfix is controlled by a set of configuration files and databases, of which /etc/postfix/main.cf and /etc/postfix/master.cf are the most important.
The first problem to be solved is that the local network we are dealing with is an internal network, i.e. not directly accessible from the Internet. This means that the names used internally have no meaning on the Internet; in short, “ape.insetti.net” cannot be reached by an external host: no one will be able to reply to a mail sent with this return address (many mail systems will even reject the message as spam prevention as it comes from an unknown host). The true address, the one visible from everybody, is assigned by the provider and, therefore, it is necessary to convert the local address “[email protected]” to the real address “[email protected]”. Postfix, if correctly configured, will take care of this when it transfers the messages.Note
Prior to version 1.5 of NetBSD, the mail configuration files were in /etc instead of /etc/mail. Since NetBSD 4.0, the /etc/mail directory is only used to store the local aliases and the corresponding postmap(1) database.
You'll probably also want to configure postfix in order to send the e-mails to the provider's mail server, using it as a relay. In the configuration described in this chapter, postfix does not directly contact the recipient's mail server (as previously described) but relays all its mail to the provider's mail server.
Since the connection with the provider is not always active, it is not necessary to start postfix as a daemon in /etc/rc.conf: you can disable it with the line “postfix=NO”. As a consequence it will be necessary to launch postfix manually when you want to transfer mail to the provider. Local mail is delivered correctly even if postfix is not active as a daemon.Note
The provider's mail server acts as a relay, which means that it delivers mail which is not destined to its own domain, to another mail server. It acts as an intermediary between two servers.
Let's start configuring postfix.