Friday, 13 April 2012

Postfix configuration in rhel6

[root@station1 ~]# yum install -y postfix*
[root@station1 ~]# vim /etc/postfix/main.cf
 75 myhostname = station1.example.com
 83 mydomain = example.com
 99 myorigin = $mydomain
113 inet_interfaces = all
116 #inet_interfaces = localhost
165 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
[root@station1 ~]# service postfix restart
Shutting down postfix:                                     [  OK  ]
Starting postfix:                                          [  OK  ]
[root@station1 ~]# mail
No mail for root
[root@station1 ~]# mail root@station1.example.com
Subject: test mail
hai root  (after this press enter and ctrl+d dont type EOT like below)
EOT
[root@station1 ~]# mail
Heirloom Mail version 12.4 7/29/08.  Type ? for help.
"/var/spool/mail/root": 1 message 1 new
>N  1 root                  Fri Apr 13 11:55  18/598   "test mail"
& 1  
Message  1:
From root@example.com  Fri Apr 13 11:55:36 2012
Return-Path: <root@example.com>
X-Original-To: root@station1.example.com
Delivered-To: root@station1.example.com
Date: Fri, 13 Apr 2012 11:55:35 +0530
To: root@station1.example.com
Subject: test mail
User-Agent: Heirloom mailx 12.4 7/29/08
Content-Type: text/plain; charset=us-ascii
From: root@example.com (root)
Status: R

hai root

&(press ctrl+d to exit)
[root@station1 ~]# mail ranjith@station1.example.com
Subject: testmail
hai ranjith...(after this press enter and ctrl+d dont type EOT like below)
EOT    
[root@station1 ~]# su - ranjith
[ranjith@station1 ~]$ mail
Heirloom Mail version 12.4 7/29/08.  Type ? for help.
"/var/spool/mail/ranjith": 1 message 1 new
>N  1 root                  Fri Apr 13 12:05  18/612   "testmail"
& 1
Message  1:
From root@example.com  Fri Apr 13 12:05:54 2012
Return-Path: <root@example.com>
X-Original-To: ranjith@station1.example.com
Delivered-To: ranjith@station1.example.com
Date: Fri, 13 Apr 2012 12:05:54 +0530
To: ranjith@station1.example.com
Subject: testmail
User-Agent: Heirloom mailx 12.4 7/29/08
Content-Type: text/plain; charset=us-ascii
From: root@example.com (root)
Status: R

hai ranjith...

& R 1
To: root@example.com
Subject: Re: testmail

root@example.com (root) wrote:

> hai ranjith...
hai root i got your mail.

EOT
& d   (to delete the mail) or s to save the mail in mbox
& q   (quit)
[ranjith@station1 ~]$ exit
logout
You have new mail in /var/spool/mail/root
[root@station1 ~]# mail
Heirloom Mail version 12.4 7/29/08.  Type ? for help.
"/var/spool/mail/root": 1 message 1 new
>N  1 ranjith               Fri Apr 13 12:07  24/780   "Re: testmail"
& 1
Message  1:
From ranjith@example.com  Fri Apr 13 12:07:37 2012
Return-Path: <ranjith@example.com>
X-Original-To: root@example.com
Delivered-To: root@example.com
Date: Fri, 13 Apr 2012 12:07:37 +0530
To: root@example.com
Subject: Re: testmail
User-Agent: Heirloom mailx 12.4 7/29/08
Content-Type: text/plain; charset=us-ascii
From: ranjith@example.com (ranjith)
Status: R

root@example.com (root) wrote:

> hai ranjith...
hai root i got your mail.

& s   (save the mail)
"/root/mbox" [New file] 26/802
& q
[root@station1 ~]# ls
anaconda-ks.cfg  Documents  install.log         mbox   Pictures  Templates
Desktop          Downloads  install.log.syslog  Music  Public    Videos



1 comment:

  1. This is only basic postfix configuration,Could you please update this with most advance configuration.

    ReplyDelete