<?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>themattharris.com &#187; macosx</title>
	<atom:link href="http://themattharris.com/tag/macosx/feed/" rel="self" type="application/rss+xml" />
	<link>http://themattharris.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 01 Jun 2010 17:30:14 +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>iTunes says &#8220;there was a problem downloading  you do not have enough access privileges&#8221;</title>
		<link>http://www.themattharris.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fthemattharris.com%2F2009%2F07%2Fitunes-says-there-was-a-problem-downloading-you-do-not-have-enough-access-privileges%2F&amp;seed_title=iTunes+says+%26%238220%3Bthere+was+a+problem+downloading++you+do+not+have+enough+access+privileges%26%238221%3B</link>
		<comments>http://www.themattharris.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fthemattharris.com%2F2009%2F07%2Fitunes-says-there-was-a-problem-downloading-you-do-not-have-enough-access-privileges%2F&amp;seed_title=iTunes+says+%26%238220%3Bthere+was+a+problem+downloading++you+do+not+have+enough+access+privileges%26%238221%3B#comments</comments>
		<pubDate>Fri, 03 Jul 2009 13:01:56 +0000</pubDate>
		<dc:creator>themattharris</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[macos]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[permissions]]></category>

		<guid isPermaLink="false">http://themattharris.com/?p=333</guid>
		<description><![CDATA[This week was one of those times where I needed to reinstall Leopard on my MacBook Pro. This is something which I do every now and then to make sure the development work i&#8217;ve doing hasn&#8217;t completely messed up my system. Normally this goes very well but this time iTunes decided to misbehave. The symptoms [...]]]></description>
			<content:encoded><![CDATA[<p>This week was one of those times where I needed to reinstall Leopard on my MacBook Pro. This is something which I do every now and then to make sure the development work i&#8217;ve doing hasn&#8217;t completely messed up my system. Normally this goes very well but this time iTunes decided to misbehave. <span id="more-333"></span></p>

<h2>The symptoms</h2>

<ul>
<li>You try and listen to some songs and you get asked to authorise the computer. You do this but the next song owned by the same account asks you to authorise again.</li>
<li>When you try and update applications for your iPhone you get an error -5000 on the downloads page</li>
<li>As with the appstore, you get an error -5000 when podcasts are being downloaded.</li>
</ul>

<h2>The problem</h2>

<p>This is such a trivial problem that it took a little while to work out what was going on. What&#8217;s happening is iTunes is unable to modify any of it&#8217;s files because of the permissions on the iTunes folders.</p>

<h2>The solution</h2>

<p>If your iTunes library is stored on an external hard drive (mine is), you can tell Finder to ignore permissions on the drive. To do this:</p>

<ul>
<li>Click on the drive in Finder</li>
<li>Choose <code>File -&gt; Get Info</code> (or press Command-I)</li>
<li>In the bottom right of the information panel that appears, check the padlock is unlocked.</li>
<li>If it isn&#8217;t unlocked, click it and enter your logon password</li>
<li>Put a tick in the <code>ignore ownership on this volume</code> box</li>
</ul>

<p>Alternatively, if your iTunes library is in your Music folder:</p>

<ul>
<li>Select your Music folder in Finder</li>
<li>Choose <code>File -&gt; Get Info</code> (or press Command-I)</li>
<li>In the bottom right of the information panel that appears, check the padlock is unlocked.</li>
<li>If it isn&#8217;t unlocked, click it and enter your logon password</li>
<li>At the bottom of the information panel click on the gear icon</li>
<li>Choose <code>Apply to enclosed items</code> &#8211; know this can take a while if your library is large</li>
</ul>

<p>You should now find iTunes is working again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.themattharris.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fthemattharris.com%2F2009%2F07%2Fitunes-says-there-was-a-problem-downloading-you-do-not-have-enough-access-privileges%2F&amp;seed_title=iTunes+says+%26%238220%3Bthere+was+a+problem+downloading++you+do+not+have+enough+access+privileges%26%238221%3B/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Using local mail (/var/mail/user)</title>
		<link>http://www.themattharris.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fthemattharris.com%2F2009%2F06%2Fusing-local-mail-varmailuser%2F&amp;seed_title=Using+local+mail+%28%2Fvar%2Fmail%2Fuser%29</link>
		<comments>http://www.themattharris.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fthemattharris.com%2F2009%2F06%2Fusing-local-mail-varmailuser%2F&amp;seed_title=Using+local+mail+%28%2Fvar%2Fmail%2Fuser%29#comments</comments>
		<pubDate>Tue, 16 Jun 2009 13:06:37 +0000</pubDate>
		<dc:creator>themattharris</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[movemail]]></category>
		<category><![CDATA[sendmail]]></category>

		<guid isPermaLink="false">http://themattharris.com/?p=325</guid>
		<description><![CDATA[When developing websites it is quite common for there to be some kind of contact form or other mailing function. The problem is that should you, like me, have your email being forwarded through Google Mail you will find those emails never get to your Google address. The reason for this is simple, your computer [...]]]></description>
			<content:encoded><![CDATA[<p>When developing websites it is quite common for there to be some kind of contact form or other mailing function.  The problem is that should you, like me, have your email being forwarded through Google Mail you will find those emails never get to your Google address.  The reason for this is simple, your computer is not recognised as a legitimate SMTP server so Google rejects the mail.  The good news is you can instead tell your Website to send the emails to your local computer instead.<span id="more-325"></span></p>

<p>Very simply you just need to give the website you are testing the email address <code>username@computername.local</code>. For example my username is <code>matt</code> and my computer is called <code>tribble-mbp</code> so my email would be <code>matt@tribble-mbp.local</code>. Alternatively you can instead use the computer name as <code>localhost</code> making the email<code>matt@localhost</code>.</p>

<p>Once you have the email set to your local machine you can use the built in <strong>mail</strong> program in MacOS.</p>

<h2>Using command line mail</h2>

<p>To use mail you need to fire up the Terminal.app (Finder > Go > Utilities > Terminal) and type <code>mail</code>. Most of the time you will be presented with a very boring response similar to this:</p>

<p><pre class="brush: plain;">No mail for matt</pre></p>

<p>If you do have mail you will instead see an interactive prompt similar to this:</p>

<p><pre class="brush: plain;">&gt;N  1 matt@tribble-mbp.loc  Tue Jun 16 10:40  14/493   &quot;Test&quot;
? </pre></p>

<p>This is your mailbox, and in my case shows I have 1 new message from matt@tribble-mbp.loc(al) which was sent on Tuesday June 16 at 10:20. The subject of the message is &#8220;Test&#8221;. This is helpful but how do I view the message?</p>

<h2>Handy mail commands</h2>

<table>
<tr>
<th>Command</th>
<th>Purpose</th>
</tr>
<tr>
<td><code>1</code> (or any other number)</td>
<td>Display the message with the ID equal to 1</td>
</tr>
<tr>
<td><code>help</code></td>
<td>Display the help screen</td>
</tr>
<tr>
<td>h</td>
<td>List the headers of the emails </td>
</tr>
<tr>
<td>d1</td>
<td>Delete message 1 (warning this is instant, there is no confirmation step)</td>
</tr>
<tr>
<td>d1-10</td>
<td>Delete messages 1 through 10</td>
</tr>
<tr>
<td>q</td>
<td>Quit mail</td>
</tr>
</table>

<h2>Sending mail</h2>

<p>The easiest way to send mail is to use the website you are developing but, should you wish to, you can use the command line tool. The best way to understand this is an example. We&#8217;re going to send an email to ourselves with the subject &#8220;Test&#8221; and the message &#8220;What&#8217;s up doc?&#8221;. To do this fire up Terminal.app and do the following:</p>

<ul>
<li>Enter <code>mail matt@tribble-mbp.local</code> replacing <code>matt@tribble-mbp.local</code> with the correct address for you.</li>
<li>You will be prompted for the <code>Subject:</code> so enter <code>Test</code> and press enter/return.</li>
<li>It now looks like nothing is happening but in reality mail is waiting for you to enter the body of the message. On the line that has just started type <code>What's up doc?</code> but do not press enter.</li>
<li>To finish the message we have to &#8216;interrupt&#8217; the program. We do this by holding down <code>ctrl</code> on the keyboard and pressing &#8220; (sometimes you need to press it a couple of times).</li>
<li>You should find the letters <code>EOT</code> appear and the program exits. If not, release any keys you have and try pressing <code>ctrl</code> and <code>d</code> again until it does.</li>
</ul>

<p>When all is done the screen should look similar to this:</p>

<p><pre class="brush: plain;">mail matt@tribble-mbp.local
Subject: Test
What's up doc?EOT</pre></p>

<p>Great! you&#8217;ve sent your first mail. Lets take a look at it by entering <code>mail</code> in the terminal. You should find something similar to this:</p>

<p><pre class="brush: plain;">&gt;N  1 matt@tribble-mbp.loc  Tue Jun 16 10:44  14/486   &quot;Test&quot;
? 1
Message 1:
From matt@tribble-mbp.local  Tue Jun 16 10:44:10 2009
X-Original-To: matt@tribble-mbp.local
Delivered-To: matt@tribble-mbp.local
To: matt@tribble-mbp.local
Subject: Test
Date: Tue, 16 Jun 2009 10:44:10 +0100 (BST)
From: matt@tribble-mbp.local (Matt Harris)
What's up doc?</pre></p>

<p>To delete the message type <code>d1</code>, replacing the 1 with the correct ID of the message.</p>

<h2>Sending attachments</h2>

<p>Sending attachments is again something you would probably want to do using your web application however it is quite straight forward. The method here does have it&#8217;s problems with encoding but works out of the box &ndash; as this is only for development and on the local machine it&#8217;s something I&#8217;m happy living with. To send an attachment use the following command:</p>

<p><pre class="brush: plain;">uuencode /path/to/file.jpg filename-for-recipient.jpg | mail matt@tribble-mbp.local</pre></p>

<p>This will send a single message with the @file.jpg@ attached to the message. Helpful but what about sending some text with the message as well? Well, this is achieved using <code>echo</code> and the <code>|</code> technique, like this:</p>

<p><pre class="brush: plain;">(echo &quot;My message test&quot;; uuencode /path/to/file.jpg filename-for-recipient.jpg) | mail matt@localhost</pre></p>

<p>Alternatively you can send a text file as message text using the <code>cat</code> command like this:</p>

<p><pre class="brush: plain;">(cat mytextfile.txt; uuencode /path/to/file.jpg filename-for-recipient.jpg) | mail matt@localhost</pre></p>

<h2>Summary</h2>

<p>Hopefully this has been useful for you. I found it partifularly helpful for debugging this. Knowing how mail works also means you can setup automated mailings from your MacOS to yourself, such as log files or alerts.</p>

<p>When you start using mail a lot, managing messages in the command line can become quite laboured so in my next post I&#8217;ll show you how to read the command line mail using Thunderbird.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.themattharris.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fthemattharris.com%2F2009%2F06%2Fusing-local-mail-varmailuser%2F&amp;seed_title=Using+local+mail+%28%2Fvar%2Fmail%2Fuser%29/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
