CentOS 7.x postfix based email archive server

From Notes_Wiki
Revision as of 03:36, 15 October 2017 by Saurabh (talk | contribs) (Created page with "<yambe:breadcrumb>CentOS_7.x_postfix_configuration|CentOS 7.x postfix configuration</yambe:breadcrumb> =CentOS 7.x postfix based email archive server= ==Archive to single re...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<yambe:breadcrumb>CentOS_7.x_postfix_configuration|CentOS 7.x postfix configuration</yambe:breadcrumb>

CentOS 7.x postfix based email archive server

Archive to single recipient address

To archive (copy) all incoming and all outgoing emails from postfix to another server (Typically for compliance and backup) use:

  1. Edit /etc/postfix/main.cf and add always_bcc=<receipient_address>. For example
    always_bcc=archives@backup.sbarjatiya.com
  2. systemctl reload postfix

The receipient address should not be on the same email server / domain. You can use a sub-domain such as archives@backup.sbarjatiya.com where backup.sbarjatiya.com email server is different than sbarjatiya.com email server.

Refer:


Archive with same username on destination as source

To archive with same username on destination as source use following steps:

  1. Edit /etc/postfix/main.cf
    sender_bcc_maps=pcre:/etc/postfix/sender_bcc_map
    recipient_bcc_maps=pcre:/etc/postfix/recipient_bcc_map
  2. In /etc/postfix/sender_bcc_map use:
    /^(.*)@<domainname>$/ $1@<backup-hostname>.<domainname>.com
    For example:
    /^(.*)@sbarjatiya\.com$/ $1@backup.sbarjatiya.com
  3. Similalry in /etc/postfix/recipient_bcc_map use:
    /^(.*)@<domainname>$/ $1@<backup-hostname>.<domainname>.com
    For example:
    /^(.*)@sbarjatiya\.com$/ $1@backup.sbarjatiya.com
  4. Optionally, if MX record lookup is not desired and mails need to be delivered to some other address, edit /etc/postfix/transport
    backup.sbarjatiya.com smtp:[in.sbarjatiya.com]:2025
    Here, SMTP server on in.sbarjatiya.com is running on port 2025. Also backup.sbarjatiya.com need not be a valid FQDN or it can be different from in.sbarjatiya.com. *If IP address is used then [] are required around the IP address*.
  5. postmap /etc/postfix/transport
  6. systemctl reload postfix


Refer:



<yambe:breadcrumb>CentOS_7.x_postfix_configuration|CentOS 7.x postfix configuration</yambe:breadcrumb>