CentOS 8.x postfix rewrite sender address on outgoing email

From Notes_Wiki
Revision as of 03:19, 30 March 2022 by Saurabh (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Home > CentOS > CentOS 8.x > CentOS 8.x email servers > CentOS 8.x postfix > 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:



Home > CentOS > CentOS 8.x > CentOS 8.x email servers > CentOS 8.x postfix > CentOS 8.x postfix rewrite sender address on outgoing email