|
Copy Emails Send by a Mail Server to an address |
|
|
|
|
Sometimes it is useful to send copy of mails sent by some email addresses within an organization to an address for audit purposes. This tutorial will shows how to configure postfix to do this task.
We asume you have installed and configured postfix as a mail server.
We will automaticaly BCC (send blind carbon copy) the email to an address using always_bcc variable.
Edit /usr/local/etc/postfix/main.cf and add the following line:
always_bcc =
This email address is being protected from spam bots, you need Javascript enabled to view it
After that restart postfix by issuing: /usr/local/etc/rc.d/postfix reload
Note: This setup will send a blind copy of every email sent through mail server to
This email address is being protected from spam bots, you need Javascript enabled to view it
. If you do not want to receive a copy of every email sent by every user, but only to receive copy from emails sent by some users, you can create a blind carbon copy map with list of that users. It is also possible to send copy of emails to multiple emails addresses too.
Define a BCC map within postfix: Edit /usr/local/etc/postfix/main.cf and add the following line:
sender_bcc_maps = hash:/usr/local/etc/postfix/sender_bcc
After that, create a file /usr/local/etc/postfix/sender_bcc with the following content
This email address is being protected from spam bots, you need Javascript enabled to view it
This email address is being protected from spam bots, you need Javascript enabled to view it
This email address is being protected from spam bots, you need Javascript enabled to view it
This email address is being protected from spam bots, you need Javascript enabled to view it
Save file and exit.
Note that
This email address is being protected from spam bots, you need Javascript enabled to view it
is the username of an email account from your mail server. If you do not have username as user@domain, but only user, then use:
user1
This email address is being protected from spam bots, you need Javascript enabled to view it
user2
This email address is being protected from spam bots, you need Javascript enabled to view it
Also note that
This email address is being protected from spam bots, you need Javascript enabled to view it
could be on other mail server.
If you want to send copy on the same server and username are as user (without domain name) you can use:
user1 miguel user2 miguel
Next step: run postmap over the newly created file to build Berkeley DB for map file:
postmap /usr/local/etc/postfix/sender_bcc
Last step is to restart postfix:
/usr/local/etc/rc.d/postfix reload
|