Posts

How to copy (bcc) all mail from specific senders to another address

Sender BCC Maps allow you to specify one or more senders along with a bcc_recipient address.
When an incoming or outgoing message matches sender_bcc_maps, the message is BCCd to the specified address

A few examples
  • BCC all mail sent from a fax or copier to a Fax/Copier archive
  • Bob wants all mail he sends from his 3 company addresses copied to his AOL account
  • Audit mail from a specific address

Create the sender_bcc file

Here is how I would create the file using pico.
note: when done editing with pico, hit ctrl-x to exit and y to save

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

Then you can start entering the following:

# sender-address [space(s)]  bcc-address
sender@example.com    archive@example.com
anothersender@example.com    archive@example.com

Alternatively you can use a plain text editor of your choice.

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

Tell postfix where to find your new sender_bcc file then reload postfix

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

To disable sender_bcc_maps

sudo /Applications/Server.app/Contents/ServerRoot/usr/sbin/postconf -e sender_bcc_maps=
sudo /Applications/Server.app/Contents/ServerRoot/usr/sbin/postfix reload

Why don’t I see X-Spam-Status headers ?

By default, amavisd adds the X-Spam-Status header only when the score is 2.0 or higher.

Edit

/Library/Server/Mail/Config/amavisd/amavisd.conf

and look for

$sa_tag_level_deflt  = 2.0;  # add spam info headers if at, or above that level

You want to see X-Spam-Status headers on all mail, even non-spam – so make it a negative number.

$sa_tag_level_deflt  = -999.0;  # add spam info headers if at, or above that level

Stop amavisd (it will be automatically re-started)

sudo launchctl stop org.amavis.amavisd

MCrypt Installer for OS X Server

Compatibility

  • OS X 10.11.x El Capitan with Server app 5.x (SIP compatible)
  • OS X 10.10.x Yosemite with Server app 4.x or 5.x
  • OS X 10.9.x Mavericks with Server app 3.x
  • OS X 10.8.x Mountain Lion with Server app 2.x

Note: If MCrypt is already installed and loadable by PHP, the installer will exit without making changes.


For both, OS X 10.10 and 10.11 with OS X Server 5

The PHP module installed here:

/usr/local/lib/php/extensions/mcrypt.so

We add/edit the mcrypt module location in /etc/php.ini

extension=/usr/local/lib/php/extensions/mcrypt.so

For OS X 10.8, 10.9 and 10.10 with OS X Server 2-4

PHP modules are installed here:

/usr/lib/php/extensions/no-debug-non-zts-20121212/mcrypt.so
/usr/lib/php/extensions/no-debug-non-zts-20100525/mcrypt.so
/usr/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so

Your system will use the correct version

We enable the mcrypt module location in /etc/php.ini

extension=mcrypt.so

What is installed and how do I remove files installed by this package.

Please see the Installer FAQ.

The topicdesk Mcrypt installer is a free download.

 

 

How to enable/disable greylisting on OS X 10.10 Yosemite and OS X 10.11 El Capitan With Server 5?

Click here to learn more about greylisting.

To disable greylisting:

sudo serveradmin settings mail:postfix:greylist_enabled = no

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

To enable greylisting:

sudo serveradmin settings mail:postfix:greylist_enabled = yes

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

How Can I Copy (Bcc) All Incoming and Outgoing Email to an Email Address on OS X Server 5?

In previous OS X Server versions there was a GUI setting which allowed you to “Copy all mail to…” an email address of your choice. It does not exist anymore, but you can still set this parameter by using the command line:

sudo serveradmin settings mail:imap:postmaster_address = "myemailaddress@mydomain.tld"

sudo serveradmin settings mail:postfix:always_bcc_enabled = yes 

Make sure you change myemailaddress@mydomain.tld to the actual email address you’d like to bcc.

If for some reason the always_bcc_enabled setting does not change, it means that most likely serveradmin got stuck and you need to do some manual editing of:

/Library/Server/Mail/Config/postfix/main.cf

and change the line that starts with:

always_bcc =

to:

always_bcc = myemailaddress@mydomain.tld

After that, try the serveradmin commands again.

Besides above commands, there are many more parameters that can be set via the command line. For an overview, issue:

sudo serveradmin settings mail

Be careful when unsure about changing a parameter and always make sure you have a working backup.