For forwarding incoming mail (from outside world) using on header:
vi /etc/postfix/header_checks , inserted following lines at last.
/^From: MAILER-DAEMON@/ REDIRECT 1...@yahoo.com
/^From: postmaster@/ REDIRECT 2...@gmail.com
:wq
vi /etc/postfix/main.cf
header_checks = regexp:/etc/postfix/header_checks (removed # before
this line)
:wq
#service postfix restart
Should we restart postfix or should we give
#postmap /etc/postfix/header_checks ? after above process
Still my problem is not solved,those bounced emails are been not
redirected to 1...@yahoo.com & 2...@gmail.com. Please let me know what
shall I do.
I worked on this I got the solution, I am posting solution for my
doubt because if any one have same doubt they can easily solve.
vi /etc/postfix/main.cf
double_bounce_sender=postmaster
bounce_notice_recipient=postmaster
delay_notice_recipient,=postmaster
double_bounce_sender=postmaster
error_notice_recipient=postmaster
notify_classes = bounce, delay, policy, protocol, resource, software
:wq
vi /etc/aliases
postmaster: postmaster,1...@yahoo.com, 2...@gmail.com
:wq
run #newaliases as root
****** but now I have a small doubt with above process only headers
& subject is redirecting, if we give
bounce_notice_recipient=1...@yahoo.com, 2...@gmail.com will it redirects
with body of email ?
answers will be appreciated.