SMTP: Configure a mail transfer agent (MTA) to accept inbound email from other systems.

Share this link

In order to test a mail server, you will need to set up a DNS server.

Remove the sendmail package (sendmail is more complicated to configure):

# yum erase sendmail

Install the postfix package:

# yum install -y postfix

Add a new rule to the firewall:

# iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT

Save the firewall configuration:

# service iptables save

Activate the postfix service at boot:

# chkconfig postfix on

Start the postfix service:

# service postfix start

Let’s assume that your server is called on the network.
Edit the /etc/postfix/ file and change the following directives:

myhostname =
mydomain =
myorigin = $mydomain
inet_interfaces = all
mydestination = $mydomain, $myhostname, localhost.$mydomain, localhost
mynetworks =,

Check the syntax:

# postfix check

Check the non-default configuration:

# postconf -n

Reload the postfix configuration:

# service postfix reload

Set the ‘allow_postfix_local_write_mail_spoolSElinux boolean to ‘on’:

# setsebool -P allow_postfix_local_write_mail_spool on

Test from a client (it should display: 25/tcp open smtp):

# yum install -y nmap
# nmap

Alternatively, test from a client:

# yum install -y telnet
# telnet 25

In addition, you can look at configuring a MTA to forward (relay) email through a smart host.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

Leave a Reply

Upcoming Events (Local Time)

There are no events.

RHCSA7: Task of the day

Allowed time: 5 minutes.
Configure a cron task to write the uptime at 2PM every day.

RHCE7: Task of the day

Allowed time: 10 minutes.
Set up a default secure MariaDB database called maria and back up the database with mysqldump.

Follow me on Twitter

Poll for favorite RHEL 7 book

What is your favorite RHEL 7 book to prepare RHCSA & RHCE exams?

View Results

Loading ... Loading ...

Poll for most difficult RHCSA 7 topic

What do you think is the most difficult RHCSA 7 topic?

View Results

Loading ... Loading ...

Poll for most difficult RHCE 7 topic

What do you think is the most difficult RHCE 7 topic?

View Results

Loading ... Loading ...