Apple Mail And Folder Management

I use Thunderbird on Windows, but from time to time like to fire up Apple Mail when on my Mac.

Why is it Apple Mail on Leopard doesn’t seem to allow me to view a few mailboxes nested under the inbox on an IMAP account? I haven’t tried under POP3, though I’d venture it’s the same limitation.

You would think they would at least show it linear if it couldn’t display it under inbox. Instead what it does is just not show it. Perhaps it’s important for me to be able to presort my inbox to make it manageable.

Who Dropped The Soap?

Thanks to Bug 332174 and the advanced warning system (sarcasm), reporter had been broken on the trunk for several weeks. Since I believe in debriefing (both before a shower, and after an event where one or more lesson can be learned), here’s the play by play:

2007-07-18 – Robert Sayre fixed Bug 332174 breaking reporter.
2007-07-21 – I realize what’s going on and file bugs (Bug 389128, 389131) against myself.
2007-09-29 – Rev 1 patches posted (rough, but really not to bad).
2007-10-06Hurt my wrist, cut down on typing outside of work to give it some rest for a few days.
2007-10-20 – I’m certified an idiot, it’s broken (nice fracture actually) not sprained. My defense: Didn’t swell, no protruding bone, really wasn’t that painful unless it was under force (holding something, or opening a door). Anyway, in a brace getting the rest it deserves.
2007-10-20 – What to do (Bug 400563)?
2007-10-28 – Still in a brace, still slightly sensitive (no opening doors with it) but able to get back in the saddle. The code cowboy rides again (warning: comment referencing any cowboy not played by John Wayne punishable by death).
2007-10-30 – Officially blocking Firefox 3 (being on the radar is a good thing). Nuclear option on the table (contributing to the “80%“. Where’s Jack Bauer when you need him?
2007-10-30 – receive r= (x2) and checkin(x2) on server/client. Requesting push to live (Bug 401816). Threat neutralized. Doomsday Clock goes back 3 minutes. Jack Bauer? Crying under a desk.
2007-11-01 – Pushed server side live, late at night. Thanks to Dave Miller, Michael Morgan, and Carsten Book for staying up. Clock goes back another 2 minutes. Jack Bauer? Post Traumatic Stress Disorder. Code Cowboy? Cool and relaxed.

Added soon there after is support capturing the character set (Bug 324291). This will hopefully provide good data for fixing bugs. Thanks to Gavin Sharp for that. Also thanks to Reed Loden for checking in that and a few of the other bugs.

Code Cowboy

I’ve had my back broke once, and my hip twice, and on my worst day I could beat the hell out of you. ~ John Wayne (The Cowboys, 1972)

On a related note, I’m now typing brace free. Just no push-ups or other weight bearing (pulling is ironically ok) things for pretty much the rest of the year.

A few people recommended titles for this blog, I forget who came up with this one, but it was the one that made me laugh the most. So credit to whomever that was.

Snoopy’s Relative Redirect Bug

Snoopy is a PHP class that automates many common web browsing functions making it easier to fetch and navigate the web using PHP. It’s pretty handy. I found an interesting bug recently and diagnosed it this afternoon.

If you navigate to a 301 or 302 redirect in a subdirectory you can get something like this:

HTTP/1.1 302
Date: Sat, 13 Oct 2007 20:26:46 GMT
Server: Apache/1.3.33 (Unix)
Location: destination.xml
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8

The key thing to pay attention to here is Location: destination.xml. Say your initial request was to:

http://somesite.tld/directory/request.xml

Our next request based on the redirect should be to:

http://somesite.tld/directory/desination.xml

Instead what Snoopy is doing is appending to the hostname, resulting in an incorrect request:

http://somesite.tld/request.xml

This is correct in cases where the first character of a redirect location contains a “/”. In this case it does not, which makes it incorrect. The following patch I wrote corrects this behavior. As far as I can tell (I haven’t read every word of the spec, but many chunks over the years) the HTTP 1.1 specs RFC 2616 only dictate that URI be provided, it doesn’t seem to require full url’s. See comments for follow up discussion on the specs. My conclusion is that it’s best practice but not required to use absolute uri’s). I wouldn’t call this a very common practice, but it does exist in the wild.

— Snoopy.class.php    200511-08 01:55:33.000000000 -0500
+++ Snoopy-patched.class.php    2007-10-13 16:10:38.000000000 -0400
@@ -871,8 +871,18 @@
                                // look for :// in the Location header to see if hostname is included
                                if(!preg_match("|\:\/\/|",$matches[2]))
                                {
                                        // no host in the path, so prepend
                                        $this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host.":".$this->port;
+                                       // START patch by Robert Accettura
+                                       // Make sure to keep the directory if it doesn’t start with a ‘/’
+                                       if($matches[2]{0} != ‘/’)
+                                       {
+                                               list($urlPath, $urlParams) = explode(‘?’, $url);
+                                               $urlDirPath = substr($urlPath, 0, strrpos($urlPath, ‘/’)+1);
+                                               $this->_redirectaddr .= $urlDirPath;
+                                       }
+                                       // END patch by Robert Accettura
+
                                        // eliminate double slash
                                        if(!preg_match("|^/|",$matches[2]))
                                                        $this->_redirectaddr .= "/".$matches[2];

Code provided in this post is released under the same license as Snoopy itself (GNU Lesser General Public License).

Hopefully that solves this problem for anyone else who runs across it. It also teaches a good lesson about redirects. I bet this isn’t the only code out there that incorrectly handles this. Most redirects don’t do this, but there are a few out there that will.

Bug Bounty

Robert Kairo just announced a bug bounty program for SeaMonkey. The largest bounty is $1000 and the total for the bugs in the program is currently at $2700. Check the site for more information if you’re interested.

This is similar to bounty program Mark Shuttleworth did a few years ago. The Mozilla Security Bug Bounty Program is also available with $500 and a T-Shirt for a valid security bug.

IE Table Border Bug?

I encountered this the other day. Firefox, Safari and Opera do what I expected and believe to be correct. I’m curious if anyone can explain this, or knows of a workaround that “doesn’t suck”. Take the following testcase:

< !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html lang="en">
 <head>
    <title>IE Table Border Bug</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <style type="text/css">
        table {
            background-color: green;
            border-collapse: collapse;
            border-spacing: 0px;
        }
        table td {
            width: 100px;
            border-bottom: 3px solid red;
        }
            table td.strip {
            background-color: #fff;
            border-bottom: 3px solid #fff;
        }
    </style>
</meta></head>
<body>
<table>
       <tr>
           <td> Test</td>
           <td class="strip"> Test</td>
           <td> Test</td>
       </tr>
 
</table>
</body>
</html>

Example

Pay attention to the bottom border. Should be flush with the green cells.

Firefox 2.0

Firefox Render

Close Up:
Firefox Render (Close Up)

IE 6

IE Render

Close Up:
IE Render (Close Up)

IE 7

IE7 Render

Close Up:
IE7 Render (Close Up)

Strange, but interesting. Excuse the poor quality of the screenshots. I cut these up really quick. Perhaps this weekend I’ll do a nicer job.

Google Maps Image Variation

Some may not know this, but as you zoom in with Google Maps, the imagery that’s used may change, as a result on occasion some strange things may happen. The following is a great example.

On Lybia’s shoreline (with the Mediterranean sea), you can tell there’s either some seasonal flooding, or some big tide difference. Open that link (as is), and zoom in 1 level. You’ll be able to see the difference. Still curious if it’s flooding or a tide thing.

Edit [9/18/06]: I should note at some point this will likely prove false, as Google occasionally updates the images.

Norton AV 2006 Update

I got Norton AntiVirus 2006 a few weeks ago, and decided today to update 3 systems from 2005 to 2006. It was free (after rebate) so a worthwhile update to keep those virus definitions fresh.

One computer had trouble uninstalling, the old version (2005) then installed fine. The next system had uninstall problems (but seemed to be a bit different), and failed to install on the first attempt. The third system is literally brand new so no problems (thankfully).

They used to have a “removal tool” online you could download. In the real world we call it uninstall and include it with software, but they don’t. Now instead of a download it’s ActiveX… just to make the situation suck slightly more.

I’ve pretty much had it with Symantec. This took 20X longer than it should have. You know your product has problems when a customer is unsatisfied with free.

Cairo Builds

As Stuart mentions work on cairo/thebes builds has progressed quite a bit lately. I tried a build the other day, and I think it was the first build I’ve seen that could be used as a browser (previous builds I’ve seen were almost unusable due to rendering issues). At times it seemed graphics were loading a little slow, and there were a few small UI quirks (spacing for fonts is sometimes odd, pull down menu’s sometimes are to thin, and other little things), but it’s functional. I’m writing this post using the build right now.

Really cool to see this progress. Last time I played with one of these builds, it was pretty ugly. Can’t wait to see what this looks like in a few months.

MT 3.0 upgrade

Upgraded to MovableType 3.0 tonight. So far, smooth.

I’ve got one question though:

Anyone know of a hack to get MT to correctly encode HTML entities? Hence making & &amp;? I’d appreciate any help. It’s an essential little hack if you expect any page generated by MT to validate.

Other than that, seems good to go. Post any issues you might have.

BTW: It’s not required yet, but signup for TypeKey. If Spam continues, I might eventually require it. But for now, I’ll leave it off, and see how we do.

For the curious, the upgrade took about 1hr in total for all the installing, playing, config etc.

Much faster performance. Especially posting/rebuilding.

That’s all, good night.

Ben answers

This infinite restart bug was driving me crazy the other day. Looks like Ben has found it. And it’s not to widespread. Only nightly users.

Ugh. What a pain that bug was. Made me not use 0.9 at work. But only that system was hit by that bug. My laptop, and Macs are fine.