Newsroom Update

Beginning in May, a special Today at Apple series titled “Made for Business” will offer small business owners and entrepreneurs free opportunities to learn how Apple products and services can support their growth and success. Learn more >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Server side rule to BCC all mail from sender

The subject nearly says it all


I would like to set up a server side rule so that every message coming from my user joshua@example.com blind carbon copies vic@example.com immediately upon sending


Can this be done through a GUI or some other fairly transparent command? If not, what witchcraft will be required to do this simply?


thanks

Mac mini, OS X El Capitan (10.11.3), Server 5.0.15

Posted on Feb 5, 2016 9:28 AM

Reply
7 replies

Feb 8, 2016 5:37 AM in response to lebaowth

Learn some more about Postfix and its sender and recipient bcc maps? Additional details on the BCC parameters are available on the Postfix web site, around these parameters and around address rewriting, and there are examples posted around the 'net. The only wrinkle here — from the postconf commands that are posted and used everywhere else — is the need for the postconf -c command syntax needed on recent Server.app releases, and you can get a flavor for that in the thread how to disable OSX server 3 SMTP authentication.

Feb 8, 2016 5:41 AM in response to MrHoffman

Thank you Mr Hoffman, and forgive me for referring to you as Mr Humphries earlier. It was Friday and I was in a fit of stupor regarding how simple my need seemed to be and how complex all of the answers I was mining became.


So are you confident this CAN be done?


Again and again, it seems someone points to this notion that almost all server side mail rules are created for INCOMING mail, not outgoing mail.


I'm not averse to experimenting with some of the BCC mapping commands, but I am a little nervous about what degree of probability that I'll destroy our mail server I'm dancing around.


If you think it can be done, perhaps I'll conduct some trial and error attempts today.


Any additional insight/guidance you can offer will be most appreciated!

Feb 8, 2016 10:38 AM in response to MrHoffman

So I look at this:


sender_bcc_maps (default: empty)

Optional BCC (blind carbon-copy) address lookup tables, indexed by sender address. The BCC address (multiple results are not supported) is added when mail enters from outside of Postfix.

Specify zero or more "type:name" lookup tables, separated by whitespace or comma. Tables will be searched in the specified order until a match is found.

The table search order is as follows:

Note: with Postfix 2.3 and later the BCC address is added as if it was specified with NOTIFY=NONE. The sender will not be notified when the BCC address is undeliverable, as long as all down-stream software implements RFC 3461.

Note: with Postfix 2.2 and earlier the sender will be notified when the BCC address is undeliverable.

Note: automatic BCC recipients are produced only for new mail. To avoid mailer loops, automatic BCC recipients are not generated after Postfix forwards mail internally, or after Postfix generates mail itself.

Example:

sender_bcc_maps = hash:/etc/postfix/sender_bcc

After a change, run "postmap /etc/postfix/sender_bcc".

This feature is available in Postfix 2.1 and later.




And the syntax doesn't look intelligible to me at all. Being it simply doesn't seem like there is a beginners guide to Postfix, I'm going to go ahead and ask the stupid questions:


First off, are these instructions for editing the main.cf or the master.cf files? Or is this done through Terminal commands?


Second, if I am editing one of the main config files for Postfix, I don't understand how I specify sender and and bcc accounts?


sender_bcc_maps = joshua@example.com:/etc/postfix/vic@example.com


If I were trying to coax Postfix into triggering a BCC to vic@example.com each time joshua@example.com composed and sent an email, is that how the command should look?


Should I be using UUID's rather than email addresses? I feel like the examples don't include placeholders for the sender and the BCC recipient


Forgive my first foray into postfix

Feb 8, 2016 10:52 AM in response to MrHoffman

True that OS X uses postfix, and you'll find plenty of documentation on the topic.

But....... Most tutorials will have you running the wrong binaries (not those compiled for OS X Server app) and editing config files OS X Server doesn't use.


Best to use directions specific to OS X Server.


OS X Server: How to setup sender_bcc_maps


1. Create the text file which stores the sender bcc maps.

Use whatever method you prefer to create this file. Here is an example using pico in Terminal


sudo pico /Library/Server/Mail/Config/postfix/sender_bcc


The file may contain one more more maps with one or more spaces in between the sender and bcc_map.

It should like this:


sender@example.com    bcc@example.com
anothersender@example.com    bcc@example.com


When done, use ctrl-x to exit and hit y to save


2. Run postmap anytime you edit the sender_bcc file


sudo /Applications/Server.app/Contents/ServerRoot/usr/sbin/postmap /Library/Server/Mail/Config/postfix/sender_bcc


3. Tell postfix where to find your new sender_bcc file


sudo /Applications/Server.app/Contents/ServerRoot/usr/sbin/postconf -e sender_bcc_maps=hash:/Library/Server/Mail/Config/postfix/sender_bcc


4. Reload postfix


sudo /Applications/Server.app/Contents/ServerRoot/usr/sbin/postfix reload


That should do it.

Feb 8, 2016 12:41 PM in response to UptimeJeff

Really, really easy instructions to follow - thank you so much for spoon feeding me the answer


Honestly, after looking at it now, it is way simpler than I was making it.


But without your instructions, there is no way I would have organized the commands the way I needed to in order to work effectively the first time!


If you're ever in Cincinnati, I'll buy you a beer!

Server side rule to BCC all mail from sender

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.