How to Change Default Mail Transfer Agent in CentOS 7

Question

How to Change Default Mail Transfer Agent in CentOS ? I Recently Installed Postfix Mail server. But I think still sendmail is the default MTA. I Am using CentOS 7 Server.

Answer

In CentOS, we can use alternatives Command to Select a Default programme when there're two or more programs for the same task.

As for You question, Enter the alternatives command with Following Options in The Linux Terminal to Change Default Mails Server On CentOS.

alternatives --config mta

Once you Enter the Command, it will Display All Available MTA’s (Mails Servers) with a Selection number and You will be asked to

Enter to keep the current selection[+], or type selection number:

Type the Selection number of your preferred Mail Transfer Agent and Press Enter.

Change Default Mail Transfer Agent CentOS 7

This Should also works in CentOS 6.5