Category Archives: information

Mac OS X Mail uses “Sent Messages” folder, not “Sent”

Oh, Mac OS X…

It is pretty. But it has so many quirks. I suppose if you’ve been a long-time Mac fan these things don’t feel that weird to you, but I have to say that I’ve just come across the most non-obvious way of changing an application’s settings.

A few months back I took the plunge and made Mac OS X Mail my primary mail app. I figured all I had to do was hook up the accounts like I did on my iPhone and iPad: pick an account type, enter some credentials, and that was it. Generally-speaking, that is true. But I started running into this problem: sent messages from OS X Mail weren’t showing up in my Sent mail folders on my iPhone and iPad.

I still have lots of IMAP mail accounts. When you add those IMAP accounts to an iPhone or iPad you can go to the advanced server settings and choose where you want the Sent messages to go: on the phone/tablet or to a folder on the server. And when you pick the folder on the server you normally would pick “Sent”. Not so for OS X Mail!

OS X Mail creates a folder called “Sent Messages” and there is no indication anywhere that’s the case. If you look at the Mailboxes bar there is a Sent category which expands to show you all the sent-mail folders for all accounts you’ve connected. And if you open up your IMAP account folders you might see a Sent folder but no Sent Messages folder. As you send messages out your Sent Messages folder gets all those new sent messages.

(And, no, there is no indication in the Preferences for Mail that Sent Messages is the destination sent mail folder.)

How do you fix this? A post back in 2004 has the answer:

  • Open Mail
  • Navigate to the Sent folder of an IMAP account
  • Click the name to highlight it
  • From the Mailbox menu choose Use This Mailbox For, then choose Sent

If you look at your IMAP folders now you will see the Sent Messages folder listed.

How horrible.

Grepping with more context

I wanted to get some more context while grepping some code. Turns out there are options -A and -B that give you n number of lines after/before the matched pattern. But that can still leave you a little lost, so why not add some color?

% grep some_pattern -B 3 -A 3 --color some_file
blah blah blah
blah blah blah
blah blah blah
blah some_pattern blah
blah blah blah
blah blah blah
blah blah blah

“Why do YouTube views freeze at 301?”

Interesting interview with Ted Hamilton at YouTube by numberphile (Brady Haran):

<iframe width=”560″ height=”315″ src=”http://www.youtube.com/embed/oIkhgagvrjI” frameborder=”0″ allowfullscreen></iframe>

“The number 300 was chosen. … When the code was written … what was actually written was … less than or equal to 300.” (If view_count <= 300 then views += 1.)

Adventures in @font-face

TIL how to work with the CSS @font-face rule. The short of it is this syntax inside your CSS file:

@font-face {
  font-family: <a-remote-font-name>;
  font-weight: <weight>;
  font-style: <style>;
  src: <source 1> format("<format 1>");
  src: <source 2> format("<format 2>");
  ...
}

For example, trying to get the Magallanes font to work on this site seemed easy at first because I just copied the CSS that MyFonts.com had given me. But the problem is that the font-family attribute was the only thing that was set. As a result by setting the main font to “Magallanes” it wasn’t understanding what to do with the bold and italicized fonts.

The solution was to set:

@font-face {
  font-family: "Magallanes";
  font-weight: normal;
  font-style: normal;
  src: <source 1> format("<format 1>");
  src: <source 2> format("<format 2>");
  ...
}

Then the italics one was:

@font-face {
  font-family: "Magallanes";
  font-weight: normal;
  font-style: italic;
  src: <source 1> format("<format 1>");
  src: <source 2> format("<format 2>");
  ...
}

Then the bold-italic:

@font-face {
  font-family: "Magallanes";
  font-weight: bold;
  font-style: italic;
  src: <source 1> format("<format 1>");
  src: <source 2> format("<format 2>");
  ...
}

And so on.

Another problem of not including the font-weight or font-style was Mobile Safari (iOS/iPhone/iPad) was not using the fonts at all.

Deleting photos from an iPhone/iPad without importing

I’ve always been irked that iPhone photos can only seemingly be removed from the device by iTunes. The iPhone doesn’t show up like a normal camera device in Finder and you can’t get to it even through navigating with Terminal. Thanks to a post that came up during a little searching, it turns out the Image Capture app on Macs can do exactly that—I don’t know how to do this on a Win PC.

Yup, right in your Applications folder it turns out that there’s the Image Capture app:

If your iOS device is connected up you’ll see it on the left and then you can select any number of images and click the Delete button at the bottom of the window.