Posts Tagged ‘os x server’

BCC Mail In OS X Server

Thursday, April 4th, 2013

OS X Server has the ability to bcc mail that flows through it. This can be a good way to keep a copy of mail for the purposes of things like legal requirements. To enable this feature, once upon a time you could use the GUI in OS X Server. These days, the feature is still there but is now accessed through the command line as the always_bcc_enabled option within serveradmin’s mail settings. To enable this option, use the following command:

sudo serveradmin settings mail:postfix:always_bcc_enabled = yes

Once enabled, you will also need to supply an actual address to bcc mail to, which is done using always_bcc as follows:

sudo serveradmin settings mail:postfix:always_bcc = "backup@318.com

Next, you’ll want to

sudo serveradmin stop mail
sudo serveradmin start mail

Finally, if there are any issues, putting the postfix logging facility into debug mode can help you triangulate, done using the following command (and restarting the mail service again):

sudo serveradmin settings mail:postfix:log_level = "debug"

Basic Script for Creating Mirrors

Monday, September 12th, 2011

Moving a volume to a mirror is often the first things people do to a new server that shows up out of the box. While this script reads input about two volumes and creates a mirror based on that input, it’s easily migrated into something akin to a DeployStudio or scripted workflow:

#!/bin/bash
#Converts a standalone disk to a RAID 1 and automates adding the second member.
clear
echo -n "Enter the name of the first volume to be placed in the mirror: "
read disk_1
export disk_1nv=`echo $disk_1 | sed 's:/Volumes/::g'`
echo "
creating the $disk_1 mirror"
sleep 2
export disk_1slice=`diskutil list "$disk_1" | grep -m 1 "$disk_1nv" | grep -o "disk..."`
diskutil appleRAID enable mirror $disk_1slice
echo -n "Enter the name of the second volume to be placed in the mirror: "
read disk_2
export disk_2nv=`echo $disk_2 | sed 's:/Volumes/::g'`
export disk_2root=`diskutil list "$disk_2" | grep -m 1 "$disk_2nv" | grep -o "disk."`
export raid_uuid=`diskutil info $disk_1slice | grep "Parent RAID Set UUID" | sed -e 's_Parent RAID Set UUID:__g;s_^[ \t]*__'`
diskutil AppleRAID add member $disk_2root $raid_uuid