Entries from October, 2011

Permanently prevent OS X Mail from inserting attachments at the end of emails

OS X Mail defaults to including all attachments at the end of emails.  While useful for some file types (ZIP archives, programs, etc.), I still prefer that images be embedded exactly where I paste them in a message.

This insert-at-the-end behaviour can be disabled by unchecking an option in the Edit/Attachments menu:

Unfortunately, the option always reverts to being checked again for subsequent emails, with no obvious way to disable this behaviour permanently.  As it turns out, the solution is simple:

If you disable this option while editing an email, it will remain disabled for that message only. If you disable this option from the main window, it will remain disabled for all future messages.

Tangentially, the option to “Send Windows-Friendly Attachments” can only be toggled when you are not editing an email.  When you have a message screen open, the option is greyed out.

These options seem like perfect candidates for Mail’s Preferences menu.  Why they exist solely as menu options and why they behave this way remains a mystery to me.

Changing nginx’s worker process user on OS X

nginx defaults to running its master process as root and all workers as nobody.

You can tell nginx to run worker processes under different credentials by setting the user directive in nginx.conf.

On OS X, you need to specify a valid group as well, since nginx will default to looking for a group that doesn’t exist. You will see “nginx – getgrnam()” in the error log when this happens. The easiest solution I found is to assign the OS X staff group:

user userid staff

It probably bears mentioning that changing the runtime credentials won’t negate the need for sudo if you run your web server on port 80, since OS X (and all Unixes) will not allow nginx to use that port unless it runs as root.

Group similar apps in OS X dock with spacer tiles

OS X’s dock allows the addition of spacer tiles, blank objects that occupy the same space as an application icon.  Spacer tiles are quite helpful for organising applications into logical groups.

Adding spacer tiles is relatively simple:

  1. Launch Terminal (from Applications/Utilities).
  2. Cut and paste the following into the command line, once for each tile you want to add.  (Need 4 tiles?  Run it 4x.)
    defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
  3. Restart the dock:
    killall Dock

Spacer tiles behave like normal application icons: they can be dragged into any position, or dragged out of the dock completely to remove them.