<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Information Knowledge Database &#187; iPhone</title>
	<atom:link href="http://blog.danielschroeter.de/category/iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.danielschroeter.de</link>
	<description>blog.danielschroeter.de - my knowledge is YOUR knowledge</description>
	<lastBuildDate>Mon, 16 Aug 2010 18:19:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Howto fix iPhone Mail Crash at 2.0 Firmware</title>
		<link>http://blog.danielschroeter.de/iphone/howto-fix-iphone-mail-crash-at-20-firmware/</link>
		<comments>http://blog.danielschroeter.de/iphone/howto-fix-iphone-mail-crash-at-20-firmware/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 09:03:45 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.danielschroeter.de/blog/?p=184</guid>
		<description><![CDATA[Sometimes your iPhone mail client just doesn’t go.  You open mail, and it closes again.  You can’t even delete the account from the Setup application.  I’m not 100% positive, but I think this usually happens when you’ve restored your settings from a pre-2.0 phone (again, unsure whether it matters if the phone was pwned or [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes your iPhone mail client just doesn’t go.  You open mail, and it closes again.  You can’t even delete the account from the Setup application.  I’m not 100% positive, but I think this usually happens when you’ve restored your settings from a pre-2.0 phone (again, unsure whether it matters if the phone was <a href="http://www.iphone-dev.org/">pwned</a> or not).</p>
<p>You could wait for Apple to fix this bug, but with the new jailbreak tool available for 2.0 firmware, help is at hand.  Jailbreaking your phone is fairly trivial, but beyond the scope of this post.</p>
<p>Read on for the full details</p>
<p>So let’s run through what you need:</p>
<ul>
<li>One iPhone with 2.0 firmware, jailbroken and diced finely.</li>
<li>One tablespoon of OpenSSH, installed using the Cydia installer on your iPhone.</li>
<li>The IP address of your iPhone when connected via Wifi (sorry USB won’t work).</li>
</ul>
<p>Update: Now I see there is a “Mobile Terminal” app available on Cydia.  If you’re desperate you can install that, run it, enter “su” to elevate yourself to root (you’ll need the “alpine” password) then skip down to the <code>cd /var/mobile/Library</code> bit.</p>
<p>To grap the IP address, head into the Wifi settings, and tap the blue “more” arrow on the connected network:</p>
<p><a href="http://www.ben.geek.nz/wp-content/uploads/img_0002.png" rel="lightbox[184]"><img class="aligncenter size-medium wp-image-911" title="img_0002" src="http://www.ben.geek.nz/wp-content/uploads/img_0002-200x300.png" alt="" width="200" height="300" /></a></p>
<p>Ok, now we need to connect to that IP address using SSH. I use the Terminal app on my Mac, but you could just as easily use <a href="http://www.chiark.greenend.org.uk/%7Esgtatham/putty/">PuTTy</a> on your PC.  In PuTTy you’ll need to just type in the IP address to connect to.  On the Mac you want to type <code>ssh root@xxx.xxx.xxx.xxx</code> into Terminal (where xxx.etc. is the IP address of the iPhone).</p>
<p>The first time you do this, you will get a long (as in 60+ seconds) delay as the iPhone computes some cryptography stuff (a key pair I think), then it will ask you if you want to accept the key pair.  Obviously you do.  Type “yes” on the Mac or just click “OK” if you are using PuTTy.</p>
<p>Next we log in with the ubuquitous iPhone root password: alpine.  You should get something like this:<br />
<a href="http://www.ben.geek.nz/wp-content/uploads/picture-1.png" rel="lightbox[184]"><img class="alignnone size-full wp-image-917" title="login" src="http://www.ben.geek.nz/wp-content/uploads/picture-1.png" alt="" width="379" height="51" /></a></p>
<p>Now we have an interactive shell with the iPhone.  Hopefully everyone knows some basic Unix shell commands, because they teach those at primary school nowadays right?  Right?!  Anyway… your mail is stored at /var/mobile/Library/Mail.  Let’s take a look at that directory on an iPhone with “broken” mail by typing:</p>
<p><code>cd /var/mobile/Library<br />
ls -la</code><br />
<a href="http://www.ben.geek.nz/wp-content/uploads/picture-21.png" rel="lightbox[184]"><img class="alignnone size-full wp-image-915" title="root:mobile" src="http://www.ben.geek.nz/wp-content/uploads/picture-21.png" alt="" width="349" height="50" /></a></p>
<p>See that bit that says “root mobile” on the line tha ends in “Mail/”?  That means the Mail directory is owned by user “root” and group “mobile”.  This is a Bad Thing(TM).  We want it to be owned by user “mobile”, which is the user under which all iPhone apps run.  This is an easy fix using the chown command with “-R” (for recurse directories):</p>
<p><code>chown -R mobile:mobile /var/mobile/Library/Mail</code></p>
<p>Type that command, hit enter, and we’re done.  Take another look at that directory listing now:<br />
<a href="http://www.ben.geek.nz/wp-content/uploads/picture-4.png" rel="lightbox[184]"><img class="alignnone size-full wp-image-916" title="mobile:mobile" src="http://www.ben.geek.nz/wp-content/uploads/picture-4.png" alt="" width="337" height="49" /></a></p>
<p>All fixed.  Now go and run your iPhone mail app and whoop with delight.  That’s an order.</p>
<p>And I can’t leave without my standard nag: I OWN this piece of hardware.  It’s mine.  I shouldn’t have to hack it to fix it.  Grrr.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielschroeter.de/iphone/howto-fix-iphone-mail-crash-at-20-firmware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
