<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: OS X Mail - autonomous processing of email?</title>
	<link>http://ask.metafilter.com/65184/OS-X-Mail-autonomous-processing-of-email/</link>
	<description>Comments on Ask MetaFilter post OS X Mail - autonomous processing of email?</description>
	<pubDate>Tue, 19 Jun 2007 20:16:13 -0800</pubDate>
	<lastBuildDate>Tue, 19 Jun 2007 20:16:13 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: OS X Mail - autonomous processing of email?</title>
		<link>http://ask.metafilter.com/65184/OS-X-Mail-autonomous-processing-of-email</link>	
		<description>Can Mac OS X Mail be configured to autonomously process email, and based on specific From: and Subject: lines, save the attachment(s) of that email into a specific folder? &lt;br /&gt;&lt;br /&gt; I&apos;m a dinosaur and prefer to ssh into my Unix based ISP to read my mail. So never having used OS X Mail before, I have no idea if it can do this. I want to be able to send email to a seldom used POP account and have Mail running on my Mac at home automatically check that account and save an attachment based on From/Subject lines. Possible?</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2007:site.65184</guid>
		<pubDate>Tue, 19 Jun 2007 20:04:52 -0800</pubDate>
		<dc:creator>jaimev</dc:creator>
		
			<category>Apple</category>
		
			<category>Mac</category>
		
			<category>MacOSX</category>
		
			<category>OSX</category>
		
			<category>email</category>
		
			<category>Mail.app</category>
		
	</item> <item>
		<title>By: procrastination</title>
		<link>http://ask.metafilter.com/65184/OS-X-Mail-autonomous-processing-of-email#979817</link>	
		<description>Mail can do filtering, but I just looked and don&apos;t immediately see a way to get it to save attachments automatically. Check under Preferences-&amp;gt;Rules to see where you can create rules. You might have to use the rules to run an Applescript that will do the saving of the attachment. It looks like &lt;a href=&quot;http://automatorworld.com/archives/save-mail-attachments/&quot;&gt;this script&lt;/a&gt; might do that, though I haven&apos;t used it. &lt;br&gt;
&lt;br&gt;
If Mail.app cannot, you can always install and run &lt;a href=&quot;http://www.procmail.org/&quot;&gt;procmail&lt;/a&gt;.  This is hard to configure, and might be overkill.&lt;br&gt;
&lt;br&gt;
I bet it can be done, and someone smarter than me with the Mac stuff will have an answer for you soon.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.65184-979817</guid>
		<pubDate>Tue, 19 Jun 2007 20:16:13 -0800</pubDate>
		<dc:creator>procrastination</dc:creator>
	</item><item>
		<title>By: pmbuko</title>
		<link>http://ask.metafilter.com/65184/OS-X-Mail-autonomous-processing-of-email#979950</link>	
		<description>AppleScript is your friend. &lt;a href=&quot;http://www.mactech.com/articles/mactech/Vol.21/21.09/ScriptingMail/index.html&quot;&gt;This MacTech magazine article&lt;/a&gt; is also you friend. I love AppleScript, so I&apos;ll pull the juicy bits out for you. Heck, I&apos;ll do all the work, too.&lt;br&gt;
&lt;ol&gt;&lt;li&gt;Run the Script Editor (/Applications/AppleScript/Script Editor).&lt;br&gt;
&lt;li&gt;Copy and paste the following code into the script window:&lt;br&gt;
&lt;pre&gt;on perform_mail_action(theData)&lt;br&gt;
	tell application &quot;Mail&quot;&lt;br&gt;
		set theSelectedMessages to |SelectedMessages| of theData&lt;br&gt;
		set theRule to |Rule| of theData&lt;br&gt;
		repeat with a from 1 to count theSelectedMessages&lt;br&gt;
			set theOutputFolder to (&quot;Full:path:to:folder:&quot;) as string&lt;br&gt;
			set theMessages to selection&lt;br&gt;
			set theMessage to item 1 of theMessages&lt;br&gt;
			set theAttachments to every attachment of content of theMessage&lt;br&gt;
			repeat with a from 1 to length of theAttachments&lt;br&gt;
				set theAttachment to item a of theAttachments&lt;br&gt;
				try&lt;br&gt;
					set theAttachmentName to name of theAttachment&lt;br&gt;
					set theSavePath to theOutputFolder &amp;amp; theAttachmentName&lt;br&gt;
					save theAttachment in theSavePath&lt;br&gt;
				end try&lt;br&gt;
			end repeat&lt;br&gt;
		end repeat&lt;br&gt;
	end tell&lt;br&gt;
end perform_mail_action&lt;br&gt;
&lt;/pre&gt;&lt;li&gt;Replace the quoted part in parentheses with the correct, colon-separated path to your destination folder. Start with the name of your hard disk and and with a colon.&lt;br&gt;
&lt;li&gt;Save the script in a convenient spot.&lt;br&gt;
&lt;li&gt;Launch Mail.app and go to the Rules section of the Preferences.&lt;br&gt;
&lt;li&gt;Add a new rule to match for the criteria you specify and make it perform an applescript action, choosing the previously created script. Click OK to save it.&lt;br&gt;
&lt;li&gt;Close the Preferences and send yourself an email that matches the rule. If all goes well, the attachment will be saved  to your desired folder.&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ol&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.65184-979950</guid>
		<pubDate>Tue, 19 Jun 2007 22:39:58 -0800</pubDate>
		<dc:creator>pmbuko</dc:creator>
	</item><item>
		<title>By: pmbuko</title>
		<link>http://ask.metafilter.com/65184/OS-X-Mail-autonomous-processing-of-email#979951</link>	
		<description>&lt;small&gt;sorry about the extra lines in the code. looked fine on preview.&lt;/small&gt;&lt;br&gt;
&lt;br&gt;
Step 3 should finish with &quot;and &lt;em&gt;end&lt;/em&gt; with a colon.&quot;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.65184-979951</guid>
		<pubDate>Tue, 19 Jun 2007 22:42:01 -0800</pubDate>
		<dc:creator>pmbuko</dc:creator>
	</item><item>
		<title>By: pmbuko</title>
		<link>http://ask.metafilter.com/65184/OS-X-Mail-autonomous-processing-of-email#979954</link>	
		<description>One more thing: this script solution requires Mac OS X 10.4 (Tiger) or later.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.65184-979954</guid>
		<pubDate>Tue, 19 Jun 2007 22:44:40 -0800</pubDate>
		<dc:creator>pmbuko</dc:creator>
	</item><item>
		<title>By: jaimev</title>
		<link>http://ask.metafilter.com/65184/OS-X-Mail-autonomous-processing-of-email#979968</link>	
		<description>pmbuko - thanks for that Applescript. It&apos;s not quite working for me  yet (attachment isn&apos;t being saved to my output folder, with no error indications), but you gave me enough info to get me pointed in the right direction.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.65184-979968</guid>
		<pubDate>Tue, 19 Jun 2007 23:24:06 -0800</pubDate>
		<dc:creator>jaimev</dc:creator>
	</item><item>
		<title>By: pmbuko</title>
		<link>http://ask.metafilter.com/65184/OS-X-Mail-autonomous-processing-of-email#980049</link>	
		<description>Hmmm. This script works for me. For testing, make the rule match only one thing, such as the subject, and make it match exactly.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.65184-980049</guid>
		<pubDate>Wed, 20 Jun 2007 05:10:41 -0800</pubDate>
		<dc:creator>pmbuko</dc:creator>
	</item>
	</channel>
</rss>
