I have a business need. I need to send automatically generated email from a specific business address to my customers. Postfix does not help you to save it to “Sent” mailbox. Although I have mail logs telling me that emails have been sent to the correct email addresses but I really don’t know what is being sent.
Because I setup my own mail server, this is going to be really easy. There is no need to change my business code to BCC a secret address, which is not very nice.
The steps are simple.
Add the line to /etc/postfix/main.cf
sender_bcc_maps = hash:/etc/postfix/sender_bcc
Write your sender_bcc
file
[email protected] [email protected]
Generate the hash.
cd /etc/postfix postmap sender_bcc
This will generate a .db file.
Reload postfix
postfix reload
Then all your email sent from [email protected]
will automatically bcc’d to [email protected]
.
Is it also possible to make exceptions so that the email would only be forwarded if the recipient of an email is not a specific email address?
You may want to use pcre table with regex expression and pair with recipient_bcc_maps directive.