Module – 16 POSTFIX Mail configuration on RHEL 6.4

Postfix

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/master.cf
  • Edit the above configuration file as follows:

vi /etc/postfix/main.cf

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

  myhostname = host01.example.com

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

  mydomain = example.com

## 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 = 192.168.1.0/24, 127.0.0.0/8

## Line 419 – Uncomment ##

home_mailbox = Maildir/

And…

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).

Module-8_POSTFIX

 

 

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>