Configure Postfix

1- Configure Postfix Server

POSTFIX SERVER [MAIL SERVER] Remote or central computer that holds electronic mail (e-mail) messages for clients on a network. When the user requests his or her e-mail they contact the mail server, which delivers to the client computer all mail being stored.


Package-       Postfix
Port no –        25 [smtp]
Script-            /etc/init.d/postfix
Daemon-        Postfix
Config file-     /etc/postfix/main.cf

# yum install postfix* -y 

#  vim /etc/postfix/main.cf
myhostname = server-1.ashu.com        [uncomment this line and add it line no 75]
mydomain = example.com                     [uncomment it add this line 83]
myorigin = $mydomain                            [uncomment it line no 99]
inet_interfaces = all                                  [uncomment it line no 113]
#inet_interfaces = localhost                    [comment it line no 116]
 $mydomain                                               [add this end of line no 164]
mynetworks = 192.168.0.0/24, 127.0.0.0/8     [uncomment it and add network add l-264

:wq
 
# etc/init.d/postfix restart;chkconfig postfix on          (Restart Services)
# mail root@ashu.com
Subject: hi
hi this is the testing mail by mail server  {ctrl-d 2 times for save]

# mail
Heirloom Mail version 12.4 7/29/08.  Type ? for help.
“/var/spool/mail/root”: 1 message 1 new
>N  1 root                  Sun Aug 19 16:57  18/597   “hi”
& 1
Message  1:
From root@ashu.com  Sun Aug 19 16:57:53 2012
Return-Path: <root@ashu.com>
X-Original-To: root@ashu.com
Delivered-To: root@ashu.com
Date: Sun, 19 Aug 2012 16:57:53 +0530
To: root@ashu.com
Subject: hi
User-Agent: Heirloom mailx 12.4 7/29/08
Content-Type: text/plain; charset=us-ascii
From: root@ashu.com (root)
Status: R

hi this is the testing mail by mail server.

& exit
You have mail in /var/spool/mail/root
 
# adduser delhi
# passwd delhi
 redhat
 redhat
# mail delhi@ashu.com
Subject: by root
hi user delhi how are you.  {ctrl+d 2 times]

# su – delhi
$ mail

Heirloom Mail version 12.4 7/29/08.  Type ? for help.
“/var/spool/mail/delhi”: 1 message 1 new
>N  1 root                  Sun Aug 19 17:02  18/588   “by root”
& 1
Message  1:
From root@ashu.com  Sun Aug 19 17:02:35 2012
Return-Path: <root@ashu.com>
X-Original-To: delhi@ashu.com
Delivered-To: delhi@ashu.com
Date: Sun, 19 Aug 2012 17:02:34 +0530
To: delhi@ashu.com
Subject: by root
User-Agent: Heirloom mailx 12.4 7/29/08
Content-Type: text/plain; charset=us-ascii
From: root@ashu.com (root)
Status: R

hi user delhi how are you.

$ exit

MAIL ALIASES-
An email alias is simply a forwarding email address

# adduser user2
# passwd user2

# vim /etc/aliases

www:                 webmaster
webmaster:      root
noc:                   root
security:            root
hostmaster:      root
info:                   postmaster
marketing:        postmaster
sales:                postmaster
support:            postmaster
delhi:                user2

:wq
 
# newaliases

NOTE- now you will send a mail to delhi user and it will transfer to user2.

# su – user2
# mail       ( It will show the mail which send by root user to delhi user])
 

Now Working……… 

Leave a Reply

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