Module – 16 POSTFIX Mail configuration on RHEL 6.4


Postfix is the default Mail Transfer Agent (MTA) in Ubuntu. It attempts to be fast and easy to administer and secure. It is compatible with the MTA sendmail. This section explains how to install and configure postfix. It also explains how to set it up as an SMTP server using a secure connection (for sending emails securely).

Procedure to install Postfix Mail server in RHEL 6.4:

Note: TCP port used by postfix is  25

First remove the default mail agent “sendmail” from OS

  • yum remove <sendmail>
  • yum install postfix

Configuration File

  • /etc/postfix/
  • Edit the above configuration file as follows:

vi /etc/postfix/

## Line no 75 – Uncomment and set your mail server FQDN

  myhostname =

## Line 83 – Uncomment and Set domain name ##

  mydomain =

## Line 99 – Uncomment ##

myorigin = $mydomain

## Line 116 – Set ipv4 ##

inet_interfaces = all

## Line 119 – Change to all ##

inet_protocols = all

## Line 164 – Comment ##

#mydestination = $myhostname, localhost.$mydomain, localhost,   (note: comment above line)

## Line 165 – Uncomment ##

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

## Line 264 – Uncomment and add IP range ##

mynetworks =,

## Line 419 – Uncomment ##

home_mailbox = Maildir/


Restart the postfix mail service

  • service postfix restart
  • chkconfig postfix on

Great, now it is a time to check the mail server configuration

Create new user ID – student

  • useradd –d /home/student –c “student ID” –m student

As a root user, send test email to student ID <student>

$ su – root

$mail student@localhost

Subject: This is test mail

Hi, this is test  mail.


Note: “.” (dot) is to  end the mail writing and come out.


Ok, Let us check the mail status by logging as sutudent ID.

su – student

ls -ltr —> You should see the directory <Newdir >

cd Newdir/new

There you go , you should see a mails received in to your inbox (ie., Newdir/new)

Click down to download the  document (PPT).




Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>