FreeBSD comes with Sendmail already installed as the MTA which is in charge of outgoing and incoming mail.
However, the system administrator can change the system's MTA. The reasons for doing so range from wanting to try out another MTA to needing a specific feature or package which relies on another MTA. Whatever the reason, FreeBSD makes it easy to make the change.
A wide choice of MTAs is available
from the mail
category of the FreeBSD Ports Collection.
Once a new MTA is installed, configure the new software and decide if it really fulfills your needs before replacing Sendmail.
Refer to the new chosen MTA's documentation for information on how to configure the software.
If Sendmail's outgoing mail service is disabled, it is important that it is replaced with an alternative mail delivery system. Otherwise, system functions such as periodic(8) will be unable to deliver their results by email. Many parts of the system expect a functional MTA. If applications continue to use Sendmail's binaries to try to send email they are disabled, mail could go into an inactive Sendmail queue, and never be delivered.
In order to completely disable
Sendmail, including the outgoing
mail service, add or edit the following lines in
/etc/rc.conf
:
To only disable Sendmail's incoming mail service, set
in /etc/rc.conf
. More information
on Sendmail's startup options
is available in rc.sendmail(8).
The new MTA can be started during
boot by adding a configuration line to
/etc/rc.conf
. This example enables the
Postfix MTA:
#
echo
'postfix
_enable=“YES”'
>> /etc/rc.confThe specified MTA will now be automatically started during boot.
Sendmail is so ubiquitous as standard software on UNIX® systems that some software assumes it is already installed and configured. For this reason, many alternative MTAs provide their own compatible implementations of the Sendmail command-line interface in order to facilitate using them as “drop-in” replacements for Sendmail.
When using an alternative MTA,
make sure that software trying to execute standard
Sendmail binaries, such as
/usr/bin/sendmail
, actually execute
the chosen mailer instead. Fortunately, FreeBSD provides a
system called mailwrapper(8) for this purpose.
When Sendmail is operating
as installed,
/etc/mail/mailer.conf
will look like
this:
When any of the commands listed on the left are run,
the system actually executes the associated command shown on
the right instead. This system makes it easy to change what
binaries are executed when these default
Sendmail
functions are invoked.
As an example, to run
/usr/local/supermailer/bin/sendmail-compat
instead of Sendmail, specify the
paths to the installed applications in
/etc/mail/mailer.conf
:
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>.