When using postfix to send mail ,the entry in /etc/aliases does not work.

Solution Verified - Updated -

Issue

  • When using postfix to send mail,the entry in /etc/aliases does not work.
# echo "test mail" | mail -s "test" alias1
cat /etc/aliases

alias1  : root@alias.com
cat /etc/postfix/main.cf

mydestination = $myhostname, localhost.$mydomain, localhost
myhostname = test1.example.com 
mydomain = example.com
myorigin = $mydomain
relaydomain = $mydestination
relayhost = [192.168.122.100]
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
cat /var/log/maillog

Oct 29 10:10:08 test1 postfix/qmgr[3561]: B805C28750: from=<root@example.com>, size=417, nrcpt=1 (queue active) 
Oct 29 10:10:08 test1 postfix/smtp[8050]: B805C28750: to=<alias1@example.com>, orig_to=<alias1>, relay=192.168.122.100[192.168.122.100]:25, delay=0.14, delays=0.04/0.01/0.04/0.06, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 577C1E830D)
Oct 29 10:10:08 test1 postfix/qmgr[3561]: B805C28750: removed 

Environment

  • Red Hat Enterprise Linux
  • postfix

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content