Introduction

If you’re sending email alerts / notifications from the server using postfix, sender email will be like username@hostname. If you wish to get standard from address, you can follow below steps to do so.

Step 1

Create the /etc/postfix/sender_canonical, and add user -> email references as shown below

1
2
# cat /etc/postfix/sender_canonical
root    noreply-cloud@techiedrone.in

Step 2

Create /etc/postfix/sender_canonical.db file (encrypted one) using postmap utility.

1
# postmap hash:/etc/postfix/sender_canonical

Step 3

Add sender_canonical variable to /etc/postfix/main.cf (which was postfix main configuration file)

1
# postconf -esender_canonical_maps=hash:/etc/postfix/sender_canonical”

Step 4

To update the changes in postfix, do restart (or) reload postfix configuration

1
# /etc/init.d/postfix restart|reload

Step 5

Modify or add first name for a user which will display in your mailbox. Here in this example, I am updating the name for root user.

1
# chfn -f root

Step 6

Then enter Full name as you wish which will display as sender’s name in email (Here I am using it as TechieDrone Notifications for root user)

So any emails sent from root will have the email ID: noreply-cloud@techiedrone.in and the Sender’s name would be TechieDrone Notifications

Check postfix version

To identify the postfix version running in your Linux machine, use following command to check

1
# postconf -d | grep mail_version

Tested on

Above configuration settings are tested on following postfix versions using Ubuntu machine.

1
2
mail_version = 2.11.3
mail_version = 3.1.0

Still having trouble with applying canonical name  or alias for  your server’s email id, feel free to ask it through comment section 😀

Leave a Reply

avatar
  Subscribe  
Notify of