Change your Mail Transport Agent (MTA)

June 06, 2005
A Mail Transfer Agent (MTA) is a software that transfers electronic mail messages from one computer to another using a client server application architecture. An MTA is also called by a few other names such as - a Message Transfer Agent, Mail Relay, and Mail Transport Agent.

Some of the popular MTAs in use are Sendmail, Exim, and Postfix.

Fedora and Red Hat Linux distributions by default ship with Sendmail as their MTA. However, switching to another MTA such as Exim or Postfix is quite easy.

Switch between MTAs

Method 1 : alternatives command

In Fedora or Red Hat, you can change the default MTA by using the alternatives command.

With alternatives, an executable with a generic name on the file system is used to access a particular service. This executable is really a symbolic link to another symlink in the /etc/alternatives/ directory. For example, the /usr/bin/sendmail is actually a symbolic link to /etc/alternatives/mta . In order to select between Sendmail or Postfix, we just change the symlink for the /etc/alternatives/mta . This is normally done with the alternatives command. Here are some examples:

To display which MTA alternative is in use:

# alternatives --display mta

To choose from the available MTA alternatives from the command line :

# alternatives --config mta

To setup Postfix as the default mail system:

# alternatives --set mta

Method 2 : system-switch-mail

Another method of changing your default MTA in Fedora is to use the /usr/sbin/system-switch-mail or /usr/sbin/system-switch-mail-nox tool. You will first have to install the system-switch-mail package using Yum as follows.

$ su -c 'yum install system-switch-mail'

Once you have installed the system-switch-mail package, you can run one of the corresponding tools to switch between the different MTAs installed in your system. When you run the system-switch-mail[-nox] command, you will see a self-explanatory selection dialog that allows you to switch to another MTA installed in your system.

Verify that the MTA is running

To verify that the MTA of your choice has started running, open system-config-services in Fedora and see if it lists your MTA in the services that are running on your system.

Mail Transfer Agent
List of services running in Fedora