# Install Postfix

### Installing Postfix

#### Uninstall SendMail

1. Run the command below to ensure that SendMail is removed/not installed

```
yum remove sendmail
```

#### Install Postfix

1. Install Postfix with the below command  
      
    `yum install postfix`
2. Make postfix as default MTA for your system using the following command  
      
    `alternatives --set mta /usr/sbin/postfix`

<p class="callout info">Use the command below, if the above command does not work  
  
`alternatives --set mta /usr/sbin/sendmail.postfix`</p>

#### Start and Enable Postfix

1. With the below commands, start and enable Postfix

```
Start Postfix
=============

service postfix start

Enable Postfix
==============

chkconfig postfix on
```

#### Open Firewall Port

1. Open the firewall with the below commands to allow Postfix to communicate

```
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
iptables -A INPUT -m state --state NEW -m udp -p udp --dport 25 -j ACCEPT
```