CentOS 8.x postfix rewrite sender address on outgoing email

From Notes_Wiki
Revision as of 13:01, 28 September 2021 by Saurabh (talk | contribs) (Created page with "<yambe:breadcrumb self="Rewrite sender address on outgoing email">CentOS 8.x postfix|postfix</yambe:breadcrumb> =CentOS 8.x postfix rewrite sender address on outgoing email=...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<yambe:breadcrumb self="Rewrite sender address on outgoing email">CentOS 8.x postfix|postfix</yambe:breadcrumb>

CentOS 8.x postfix rewrite sender address on outgoing email

Replace only email address and not the sender name

If you want to replace only outgoing email address without changing the display name use following in /etc/postfix/main.cf:

  sender_canonical_maps = static:no-reply@<FQDN>


Replace both outgoing address and sender name

To replace outgoing (from) address on outgoing email with a desired display name use:

  1. Create file =/etc/postfix/header_checks= with following content:
    /^From:[[:space:]]+(.*)/ REPLACE From: "Your Name" <email@company.com>
  2. Configure postfix to use above configuration using:
    cd /etc/postfix
    postmap header_checks
    postconf -e 'smtp_header_checks = regexp:/etc/postfix/header_checks'
    service postfix reload


See related CentOS 8.x postfix replace addresses on outgoing email


Refer:



<yambe:breadcrumb self="Rewrite sender address on outgoing email">CentOS 8.x postfix|postfix</yambe:breadcrumb>