Mac OS X

Mail Forwarding on OS X Server 10.5 Leopard: Using /etc/aliases

I like to have my mailserver set up so that mail sent to (through a relay at comes to one of my email addresses.

On my old crufty Mac OS X Server mailserver, which runs postfix, I was wondering why mail sent to was not getting delivered, even though in /etc/aliases on clearly had the entries

apache: root

Instead, I was receiving errors like relay=cyrus, delay=0.13, delays=0.02/0.02/0/0.09, dsn=4.3.0, status=deferred (temporary failure. Command output: couldn't connect to lmtpd: No such file or directory_ 421 4.3.0 deliver: couldn't connect to lmtpd_

I was able to fix this by changing the relay from cyrus to local. That was OK since I am not using cyrus anyway; I have no local accounts on the mailserver.

I made the change by clicking a checkbox called "Deliver to "/var/mail" when POP & IMAP are disabled" in the OS X Server GUI.

The change has the effect of changing a line in /etc/postfix/


mailbox_transport = cyrus


mailbox_transport =

Postfix will now use the local transport, which actually checks /etc/aliases and delivers accordingly.

And yes, this is my last OS X Server and it's on the list to be migrated to RHEL.


Creating Open Packaging Conventions files with zip on OS X 10.6

The .docx format used by Microsoft is actually a collection of XML files (and other files) and can be opened with zip.

For example, on OS X you can use unzip at the command line to look at the OPC file like this (we'll unzip it into a directory called foo):

$ ls -l
-rw-r--r--@ 1 john  staff    13678 Feb  3 11:52 Ham.docx

$ unzip Ham.docx -d foo
Archive:  Ham.docx
  inflating: foo/[Content_Types].xml 
  inflating: foo/_rels/.rels        
  inflating: foo/word/_rels/document.xml.rels 
  inflating: foo/word/document.xml  
  inflating: foo/word/theme/theme1.xml 
  inflating: foo/word/settings.xml  
  inflating: foo/word/webSettings.xml 
  inflating: foo/word/stylesWithEffects.xml 
  inflating: foo/docProps/core.xml  
  inflating: foo/word/styles.xml    
  inflating: foo/word/fontTable.xml 
  inflating: foo/docProps/app.xml   

Now you've extracted the .docx file into a new directory called foo. You can go in there and poke around at the .xml files.

But what happens when you want to put the whole thing back together? "No problem," you might think. "I'll just use the handy-dandy Compress service to do that."

Then just rename it to foo.docx and we're all done! But...wait.

Now you're ready to take the gloves off. "I'll just do it at the command line!"

$ zip -r bar foo/*
  adding: foo/[Content_Types].xml (deflated 75%)
  adding: foo/_rels/ (stored 0%)
  adding: foo/_rels/.rels (deflated 61%)
  adding: foo/docProps/ (stored 0%)
  adding: foo/docProps/app.xml (deflated 48%)
  adding: foo/docProps/core.xml (deflated 52%)
  adding: foo/word/ (stored 0%)
  adding: foo/word/_rels/ (stored 0%)
  adding: foo/word/_rels/document.xml.rels (deflated 71%)
  adding: foo/word/document.xml (deflated 66%)
  adding: foo/word/fontTable.xml (deflated 77%)
  adding: foo/word/settings.xml (deflated 62%)
  adding: foo/word/styles.xml (deflated 89%)
  adding: foo/word/stylesWithEffects.xml (deflated 89%)
  adding: foo/word/theme/ (stored 0%)
  adding: foo/word/theme/theme1.xml (deflated 79%)
  adding: foo/word/webSettings.xml (deflated 42%)
$ mv bar.docx
$ open bar.docx


Aargh! So what's the secret? Here's the secret: cd into the directory first, then build your zip archive outside the directory. Here we cd into foo and make in the directory above, then rename it to bar.docx.

$ cd foo
$ zip -r ../bar *
  adding: [Content_Types].xml (deflated 75%)
  adding: _rels/ (stored 0%)
  adding: _rels/.rels (deflated 61%)
  adding: docProps/ (stored 0%)
  adding: docProps/app.xml (deflated 48%)
  adding: docProps/core.xml (deflated 52%)
  adding: word/ (stored 0%)
  adding: word/_rels/ (stored 0%)
  adding: word/_rels/document.xml.rels (deflated 71%)
  adding: word/document.xml (deflated 66%)
  adding: word/fontTable.xml (deflated 77%)
  adding: word/settings.xml (deflated 62%)
  adding: word/styles.xml (deflated 89%)
  adding: word/stylesWithEffects.xml (deflated 89%)
  adding: word/theme/ (stored 0%)
  adding: word/theme/theme1.xml (deflated 79%)
  adding: word/webSettings.xml (deflated 42%)
$ cd ..
$ mv bar.docx
$ open bar.docx

Presto! The .docx file opens up in Word with no corruption.


Solution to SAS 9.2 Installer Crashing on Windows 7 on VMWare Fusion

When installing SAS on Windows 7, typically you'd right-click on setup.exe and choose Run as Administrator, watch the SAS Deployment Wizard come up and the blue progress bar start moving. But! Then Windows 7 suddenly says "Console Window Host has stopped working." and offers to close the program. The Deployment Wizard may run for a while longer and silently disappear.

The entry in the Windows Application Log is not much help; it just says "Event 1000, Application Error: Faulting application name: conhost.exe".

The reason this is happening is that the SAS installer is trying to write to a temp file. Because you have VMWare Fusion set up to share folders between the Mac and the PC, when the installer tries to write a log file VMWare Fusion denies it, and the installer freaks out and dies.

The solution is:

  1. Shut down your virtual machine.

  2. Turn off "Share folders on your Mac" in the virtual machine settings.
  3. Start your virtual machine back up.
  4. Run the installer with no problems.
  5. Turn sharing back on again once SAS is installed.


Using Mac OS X 10.6 to Create a Bootable FreeBSD 8.1 Installer on a USB Memory Stick

Warning. Follow these instructions at your own risk. I am not responsible when you use dd to blow away your kitty pictures.

Download the FreeBSD 8.1 memory stick image from a FreeBSD repository. I picked one from here.

Plug in your USB stick. OS X will mount it.

You want to unmount the volume while keeping the drive available. To do this, open Disk Utility, click on the name of the mounted volume, and click the Unmount button.

Now you need to know the disk's identifier. You can find this out by right-clicking the disk in Disk Utility. The disk identifier of my USB stick was disk4.

Finally, copy the memory stick image onto the memory stick, substituting the disk identifier into this terminal command. if means "in file" and of means "out file".

dd if=/path/to/freebsd.img of=/dev/diskidentifier bs=10240 conv=sync

So the commands I issued looked like this (yours will be different, since your disk identifier will be different).

dd if=/Users/john/Downloads/FreeBSD-8.1-RELEASE-amd64-memstick.img of=/dev/disk4 bs=10240 conv=sync

When it's done, dd says:

105018+0 records in
105018+0 records out
1075384320 bytes transferred in 1310.732002 secs (820446 bytes/sec)

That's 22 minutes.

Back to Disk Utility. Select the memory stick. Click the Eject button. Now go boot FreeBSD!


Subscribe to RSS - Mac OS X