Five Pounds of Flax

Every culture has a burrito.

IMAP-IDLE 1.03 for Apple's

Saturday, September 30, 2006posted by Michael Rothwell @ 1:20 PM

Version 1.03 of the IDLE-support plugin for Apple's Mail program is available here (link disabled; see version 1.04 link, below) To whoever listed version 1.02 on MacUpdate, could you please update the entry? :)

The changes in this release:
  1. Reliance on Applescript for certain functions has been completely removed. The plugin now uses the Mail API exclusively.
  2. Handling of online/offline, active/inactive much improved
  3. Threading bug fixed (caused crash in certain situations).
  4. It is much slimmer: the ZIP file for this version is only 40k rather than the megabyte or so of previous versions.
Apple's mail client ( supports IMAP accounts, but does not support the IDLE extension (RFC 2177). IDLE is good, because it lets the server notify clients when new mail arrives, meaning that clients don't have to poll. Or at least, will get new mail more often than $POLL_INTERVAL.

This plugin adds IDLE support. It works by opening a connection for each IMAP account, selecting the INBOX, entering IDLE mode, and waiting for messages. When it gets a message from the server indicating that new mail has arrived, it causes to check for new mail in the appropriate account.

Check your console.log (/Applications/Utilities/Console) if you want to see what it's doing. The messages it logs include information on whether your IMAP server supports the IDLE extension. Here's a page describing how to tell if your server supports IDLE. Long story short: iPlanet and DotMac do not! Exchange does, as does cyrus and dovecot. This plugin is untested with Exchange. I'll verify it functions with Exchange in a future release.

** UPDATE 2006-10-11
Version 1.04 has been released.

In France, what revolves around the Earth?

Sunday, September 24, 2006posted by Michael Rothwell @ 10:40 AM

From YouTube.

HR 5295 ("warrantless searches of students") passes, goes to the Senate

Saturday, September 23, 2006posted by Michael Rothwell @ 5:16 PM

HR 5295 is several things.

  1. An election-year tough-on-crime stunt.
  2. One more step down the road of turning our schools into prisons.
  3. Obedience training for future citizens. Getting kids used to random, warrantless searches will make them more compliant to government authority in the future. Plus, when whackos complain about violations of the 4th Amendment and government abuse of power, these folks will think and say, "but I've been searched all my life; it's no big deal".
  4. Asymmetric. Are the teachers, administrators and other staff also subject to random warrantless searches? How about the politicians? What do they have to hide?

It must be stopped. Anyone performing such a search on my kids is going to receive an unpleasant visit.

Call, write and/or visit your congresscritter. It was a voice vote, so assume they are all guilty (voted for the bill) until proven innocent (can prove they didn't, or that they opposed it). Call your representative's office and request to know how they voted. Make your opposition known. Do the same for your sentator.

This bill doesn't appear to do much on top of NEW JERSEY v. T. L. O., the 1985 case that established limits to 4th Amendment protections for minors on school grounds. HR 5295 cites that case, and adds the requirement that schools must have a policy that reflects more or less what New Jersey vs TLO says is acceptable anyway. The point appears to be to make it clearer to everyone that certain kinds of searches at schools are acceptable, and have been since 1985. I am uncertain whether this policy has been law before now, or just a court ruling. After the Senate passes this will, it will be law, of course.

H.R. 5295: Student and Teacher Safety Act of 2006

Thursday, September 21, 2006posted by Michael Rothwell @ 6:28 PM

Representative Price,

I'll get straight to the point. I'm the father of two children currently in elementary school. I find H.R. 5295 ("Student and Teacher Safety Act of 2006") to be reprehensible. It seems to be little more than obedience training for the citizens of tomorrow. Teaching them that random searches are normal is not a good way to educate citizens about living in a free country.

-Michael Rothwell

IDLE support for IMAP accounts in Apple's

Monday, September 18, 2006posted by Michael Rothwell @ 11:18 PM

Apple's mail client ( supports IMAP accounts, but does not support the IDLE extension (RFC 2177). IDLE is good, because it lets the server notify clients when new mail arrives, meaning that clients don't have to poll. Or at least, will get new mail more often than $POLL_INTERVAL.

I'm writing a plugin (a "mailbundle") for that implements support for IDLE. It opens a connection for each IMAP account, selects the INBOX, enters IDLE mode, and waits for messages. When it gets a message from the server indicating that new mail has arrived, it causes to check for new mail in that account.

The first working version is running in debug mode on my Mac right now, monitoring mail over an SSL connection to my IMAP server. It won't reconnect if disconnected, currently, and ignores network state. Those are to-do items.

I'll release it on VersionTracker when it's ready for public consumption.

The first release version can be downloaded here (link disabled). It's a Universal Binary, reconnects when disconnected, and is working well on my MBP and my wife's Powerbook. You must be running Tiger (10.4.x) to use this.

Not all IMAP servers support IDLE. As a future update to the IDLE plugin, I'll have it report back about your server's capabilities. Until then, here's a page describing how to tell if your server supports IDLE. Long story short: iPlanet and DotMac do not! Exchange does, as does cyrus and dovecot.

Version 1.01 is available here: (link disabled). It is a minor update to fix problems some folks were having with particular IMAP servers; the plugin was failing to recognize that the server was in IDLE mode due to the server giving a response unexpected by my code. If version 1.0 is working for you, there's no reason to update to 1.01.

I've gotten a number of great bug and usage reports. Thanks, everyone! I'm working on the following issues:
  1. Observing the "enabled/disabled" status of individual mail accounts
  2. Observing the "online/offline" status of Mail.
I'll have an update out in the next day or two, probably!

** UPDATE 2006-09-26
Version 1.02 (link disabled) is available. It respects the "enabled" setting for individual accounts, and handles accounts being taken "offline". It also checks for your server's capability to support the IDLE extension and reports yea or nay back in the console log (see /Applications/Utilities/ This version is working for my very small group of testers (me, my wife). Give it a shot!

** UPDATE 2006-09-30
Version 1.03 is available here.

Microsoft's Remote Desktop Client on an Intel Mac

Friday, September 15, 2006posted by Michael Rothwell @ 3:19 PM

Microsoft's Remote Desktop Client for the Mac, which is PPC-only (not a universal binary), occasionally fails to launch on an Intel machine. The dock icon bounces forever, and CPU usage is high. To get it launching again, delete the folder ~/Library/Preferences/MLinkicrosoft/RDC Client -- apparently its preferences or default settings get corrupted over time.

I use rdesktop (compiled myself) under Apple's X11 more often, as it's much faster, and more configurable. For example, I have the display resolution with rdesktop set to 1600x1100 (command-line options in use: rdesktop -g 1600x1100 -z -xm -a16), so that it's max size on my 1600x1200 display, but does not overlay my dock.

Some kind soul packaged TSClient as in intel-mac .app. It's an X11 app, and probably rdesktop under the covers, but has a GUI.

** UPDATE: New/better link for TSClientX is
. And yes, it's redesktop and some other stuff (listed on that site) under the covers. It works!

Rails + Laszlo? Flex?

Thursday, September 14, 2006posted by Michael Rothwell @ 1:06 AM

The Laszlo folks have a new thing called "Legals" (announcement). Laszlo/OpenLaszlo is a "Rich Internet Application" thing that generates Flash (SWF) files as the UI for web applications. "Legals" targets more than just Flash, though, and can render a "Laszlo" UI as DHTML, which is pretty neat. Apparently the Legals team intends to support "other targets" in the future, presumably SVG and WPF/E. I hope they support Rails.

The older OpenLaszlo has support available for Rails. The OpenLaszlo Project Blog talks about it. A guy named Rodney got it working on the Mac, and through the magic of google, I became aware of this feat.

Adobe has released a Rails SDK for Flex, which is their RIA-generates-SWF solution.

Treo 650 and the dreaded "AirSAMStateMachine" error

posted by Michael Rothwell @ 12:55 AM

My Treo 650 quit syncing calendar events a while back. It would reliably generate an "AirSAMStateMachine.c" error.

I found the secret decoder ring for these messages. "1509" means "Sync interface: Sync protocol has encountered an error. It is usually followed by status code to indicate its particular definition." Sure enough, it's followed by "Status: 5", which means, simply, "Server error.".

The Exchange server wass not logging an error, though. Nothing in the event log. Nothing in the IIS log. I applied the standard exchange ritual voodoo: checked information store for errors using eseutil, etc; ensured IIS was bound to all IP addresses (the server is multihomed), verified Exchange 2003 SP2 was installed, ensured "basic" and "integrated" auth were enabled and that SSL was not required. Nothing helped.

But I did, in the end, get my Palm syncing again. I simply deleted the mail account on the Treo and re-created it. Apparently the "server error" was really an internal Versamail error.

Endian Firewall!

Tuesday, September 12, 2006posted by Michael Rothwell @ 11:35 AM

Well, I dumped FC4 on my home firewall. The problems I was having with IPSec were due to kame/racoon/ipsec-tools.

IKE is the devil.

I'm now running Endian Firewall, which uses OpenSwan (Pluto, et al). Literally minutes of work to get three VPN tunnels up and working!

IPSec between FC4 and IOS

Saturday, September 02, 2006posted by Michael Rothwell @ 6:34 PM

Does anyone know what this means?

ERROR: proto_id mismathed: my:2 peer:3
ERROR: proposal mismathed.
ERROR: failed to pre-process packet.
ERROR: phase2 negotiation failed.

What's "2"? What's "3"?

Run vmware server console on a Mac

posted by Michael Rothwell @ 9:39 AM

Ok, it's not really running *on* the Mac, but keep reading. I tried running the Windows version using Crossover Office (e.g., Wine for Mac), and although it installed, it would never run. So I tried running the Linux version, from a Linux machine, using Apple's X11. It worked! TAO of Mac has some instructions.

Long story short:

  1. ssh -Y to a linux machine with vmware-server-console installed.
  2. edit ~/.vmware/preferences to add a line like xkeymap.language="pt104"
  3. run vmware-server-console
Ta-da, you're managing virtual machines from your Mac.