Postfix: send a copy of each email to the specified email address

I have a postfix mail server and there is a problem that I want to debug. How can I configure it to send a copy of each letter to my email address (in addition to delivering the letter to its intended recipients).

+5
source share
2 answers

I recently got this working, so although I would share:

Sending all outgoing mail to Sent folders with postfix and cyrus imap.

Summary

postfix "" . , "", .

  • - unix , /bin/false, :

    host$ sudo useradd sent
    host$ sudo chsh -s /bin/false sent
    
  • imap

    cyradm, (.. ) "" imap:

    host$ $ cyradm -user cyrus localhost
    Password: <enter you cyrus user admin password here>
    localhost> createmailbox user.sent
    localhost> setaclmailbox user.%.Sent sent append
    Setting ACL on user.userx.Sent...OK.
    Setting ACL on user.usery.Sent...OK.
    . . .
    Setting ACL on user.userz.Sent...OK.
    localhost> exit
    
  • script

    script , ​​ "" .

    script sent.sieve :

     # Sieve script for sent.  If outgoing email is bcc'ed to this account,
     # this sieve script will redirect it to the sender Sent folder
     require ["fileinto"];
    
     if address :is :localpart "From" "userx" {
       fileinto "user.userx.Sent";
     }
     elsif address :is :localpart "From" "usery" {
       fileinto "user.usery.Sent";
     }
     elsif address :is :localpart "From" "userz" {
       fileinto "user.userz.Sent";
    }
    

    (userx, usery, userz ). . marc@bloodnok.com

    script :

    host$ sieveshell localhost -user=sent -a=cyrus
    Password: <enter you cyrus user admin password here>
    > put sent.sieve
    > activate sent.sieve
    > quit
    
  • bcc postfix

    (/etc/postfix debian) bcc_map :

    # copy all locally sent mail to the sent account
    @yourdomain.com       sent@yourdomain.com
    

    , :

    host$ sudo postmap bcc_map
    

    postfix main.cf:

    sender_bcc_maps = hash:/etc/postfix/bcc_map
    

    postfix :

    host $sudo/etc/init.d/postfix reload

  • , Sent.

    cyrus postfix ( /var/log/syslog debian). , .

+8

always_bcc=youremail@gmail.com /etc/postfix/main.cf . .

, . always_bcc

.

+2

All Articles