<?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>mark.bockenstedt.net &#187; Email</title>
	<atom:link href="http://mark.bockenstedt.net/tag/email/feed/" rel="self" type="application/rss+xml" />
	<link>http://mark.bockenstedt.net</link>
	<description>Tech Tips, How-To's, and Miscellaneous Geekery</description>
	<lastBuildDate>Tue, 19 May 2009 03:05:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Backup Your Gmail With&#8230; Gmail Backup</title>
		<link>http://mark.bockenstedt.net/2008/11/05/backup-your-gmail-with-gmail-backup/</link>
		<comments>http://mark.bockenstedt.net/2008/11/05/backup-your-gmail-with-gmail-backup/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 19:20:34 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://mark.bockenstedt.net/?p=492</guid>
		<description><![CDATA[Yesterday&#8217;s article was written giving instructions on how to back up all your email accounts using some pretty simple techniques. In the end, Thunderbird was the agent that we used to grab all the email from our gateway account. Today, I&#8217;d like to show you how we can accomplish the same thing with a different [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday&#8217;s article was written giving instructions on how to back up all your email accounts using some pretty simple techniques. In the end, <a href="http://mozilla.org/thunderbird">Thunderbird</a> was the agent that we used to grab all the email from our gateway account. Today, I&#8217;d like to show you how we can accomplish the same thing with a different service called <a href="http://www.gmail-backup.com/">Gmail Backup</a>.</p>
<p>Rather than copy and paste all of <a href="http://mark.bockenstedt.net/2008/11/04/how-to-use-gmail-as-an-email-backup-service/">yesterday&#8217;s article</a> to this one, please read that article and come back to this one. The only difference will be in step 3, which is the step in which we&#8217;re actually pulling email to the local machine.</p>
<p><span id="more-492"></span></p>
<p><strong>New Step 3</strong></p>
<p>The previous method used POP to download email. This step will use a different protocol called IMAP. Here&#8217;s the info you&#8217;ll need for <a href="http://mail.google.com/support/bin/answer.py?answer=77695">enabling IMAP</a> on your gateway account. Once you&#8217;ve got IMAP enabled, you need to download the Gmail Backup program, available for <a href="http://home.zcu.cz/~honzas/gmb/gmail-backup-0.104.exe">Windows</a> or <a href="http://www.gmail-backup.com/files/gmail-backup-0.104-linux.zip">Linux</a>. Once you have your client of choice, jump to the appropriate section below for instructions on setting up the client.</p>
<p><strong>Generic Setup<br />
</strong></p>
<p>For the most part, this software can be used uniformly across multiple platforms. If you want to use the GUI version in Linux, you need to install the WxPython packages (python-wxgtk2.8 in Ubuntu). You can also run it from the command line in any platform. With command line access comes the ability to script and schedule updates! The command line version may also work on OS X, but the GUI version doesn&#8217;t (yet).</p>
<p><strong>GUI Version</strong></p>
<p>I&#8217;ll just walk through this once, since it&#8217;s the same for both platforms. After installing (or extracting) Gmail Backup, launch the executable. If you&#8217;re on Linux, you want to run the gmail-backup-gui.sh file. You&#8217;ll be presented with a window like this one:</p>
<p><a href="http://mark.bockenstedt.net/wp-content/uploads/2008/11/picture-4.png"><img class="alignnone size-medium wp-image-493" title="Gmail Backup GUI" src="http://mark.bockenstedt.net/wp-content/uploads/2008/11/picture-4-300x298.png" alt="" width="180" height="179" /></a></p>
<p>Fill in the first three text boxes in the GUI. If you only want to grab email for a date range, you can specify that in the Since Date and Before Date fields. This will allow you to grab email from only a certain timeframe, which makes it easier to archive your email by month.</p>
<p>Once you&#8217;ve got your archive, you can put it in your Dropbox or another safe location.</p>
<h3><strong>Linux &#8211; Command Line<br />
</strong></h3>
<p>I want to spend more time on this part because, let&#8217;s face it, I&#8217;m lazy and I like having things done for me. When run from the command line, the Linux variant of Gmail Backup can be be extremely powerful. You can easily set up Cron jobs to run the backup at a defined interval and use command line arguments to drill down to exactly what you want and where you want to place the backup.</p>
<p><strong>1. Install Dropbox (optional)</strong></p>
<p>If you plan on using Dropbox to store your backups, you can find Linux Dropbox packages <a href="https://www.getdropbox.com/install?os=linux">here</a>. When you&#8217;re run Dropbox and have defined a folder to use, you can proceed.</p>
<p><strong>2. Tweak Command<br />
</strong></p>
<p>In the folder you extracted from the Gmail Backup archive, you&#8217;ll find gmail-backup.sh. There are a number of command line arguments you can pass to this bash script. Whichever method you choose, you should consider appending <code>2&gt;&amp;1 /dev/null</code> at the end because the command will generate a considerable amount of output. I only recommend doing this AFTER you&#8217;ve run it successfully so you know that it&#8217;s doing what its supposed to.</p>
<p><strong>a. Cumulative Backup</strong></p>
<p>For a cumulative backup (i.e. everything), simply use the following.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>gmail-backup.sh backup <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>backup<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">dir</span> gateway<span style="color: #000000; font-weight: bold;">@</span>gmail.com password</pre></div></div>

<p><strong>b. Incremental Backup</strong></p>
<p>Here&#8217;s a shot of what the file structure should look like on your disk (this is all in my home directory).</p>
<p><a href="http://mark.bockenstedt.net/wp-content/uploads/2008/11/picture-1.png"><img class="alignnone size-medium wp-image-494" title="Backup Folder Structure" src="http://mark.bockenstedt.net/wp-content/uploads/2008/11/picture-1.png" alt="" width="232" height="170" /></a></p>
<p>Incremental backups are more useful and easier to organize. Here&#8217;s the syntax for that.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>gmail-backup.sh backup <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>backup<span style="color: #000000; font-weight: bold;">/</span>dir<span style="color: #000000; font-weight: bold;">/</span>subdir gateway<span style="color: #000000; font-weight: bold;">@</span>gmail.com password <span style="color: #000000;">20081001</span> <span style="color: #000000;">20081031</span></pre></div></div>

<p>The last two arguments specify a start and end date for archiving. This example will archive everything from October 1, 2008, to October 31, 2008. But how do you calculate those dates in Bash, you ask?</p>
<p>You can use the &#8211;date parameter of the date command to get past and future dates. For instance, if you want to run a backup of your email for the last week (not including today, obviously), you can do something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>gmail-backup.sh backup <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>backup<span style="color: #000000; font-weight: bold;">/</span>dir<span style="color: #000000; font-weight: bold;">/</span>subdir gateway<span style="color: #000000; font-weight: bold;">@</span>gmail.com password <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>Y<span style="color: #000000; font-weight: bold;">%</span>m<span style="color: #000000; font-weight: bold;">%</span>d <span style="color: #660033;">--date</span>=<span style="color: #ff0000;">&quot;7 days ago&quot;</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>Y<span style="color: #000000; font-weight: bold;">%</span>m<span style="color: #000000; font-weight: bold;">%</span>d <span style="color: #660033;">--date</span>=<span style="color: #ff0000;">&quot;1 day ago&quot;</span><span style="color: #000000; font-weight: bold;">`</span></pre></div></div>

<p>I realize that&#8217;s pretty ugly, but it does the trick. If you&#8217;re ambitious enough to use a wrapper to get full control over directories, timeframes, etc., you can use something similar to <a href="http://mark.bockenstedt.net/wp-content/uploads/gmail-backup.txt">this</a>.</p>
<p><strong>3. Insert Into Cron</strong></p>
<p>This is the easy part &#8211; all you have to do is decide on a frequency and then make sure your $sd variable in the bash script matches that. If you run it every week, $sd should go back 7 days; if you run it every month, it should go back 1 month, etc. The command to run the script every Sunday at midnight:</p>
<pre>0 0 * * 7 cd /home/mark/email_backup; ./gmail-backup.sh;</pre>
<p><strong>Restoring Archives</strong></p>
<p>It&#8217;s important that I tell you that you can also restore backups made this way. However, I feel that it&#8217;s outside of the scope of this article. For info on that, check out the documentation page of Gmail Backup&#8217;s website.</p>
<h3  class="related_post_title"><h2>Related Posts</h2></h3><ul class="related_post"><li><a href="http://mark.bockenstedt.net/2008/11/04/how-to-use-gmail-as-an-email-backup-service/" title="How To Use Gmail as an Email Backup Service">How To Use Gmail as an Email Backup Service</a></li><li><a href="http://mark.bockenstedt.net/2008/10/31/google-alerts-rss-style/" title="Google Alerts, RSS Style">Google Alerts, RSS Style</a></li><li><a href="http://mark.bockenstedt.net/2008/09/23/creating-a-fluid-based-google-reader-app/" title="Creating a Fluid-Based Google Reader App">Creating a Fluid-Based Google Reader App</a></li><li><a href="http://mark.bockenstedt.net/2008/09/22/laconica-xmpp-sms-oh-my/" title="Laconica, XMPP, SMS, Oh My!">Laconica, XMPP, SMS, Oh My!</a></li><li><a href="http://mark.bockenstedt.net/2008/08/24/noise-filtering-on-google-search-results/" title="Noise Filtering on Google Search Results">Noise Filtering on Google Search Results</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://mark.bockenstedt.net/2008/11/05/backup-your-gmail-with-gmail-backup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Use Gmail as an Email Backup Service</title>
		<link>http://mark.bockenstedt.net/2008/11/04/how-to-use-gmail-as-an-email-backup-service/</link>
		<comments>http://mark.bockenstedt.net/2008/11/04/how-to-use-gmail-as-an-email-backup-service/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 20:05:47 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Computers & Tech]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Thunderbird]]></category>

		<guid isPermaLink="false">http://mark.bockenstedt.net/?p=484</guid>
		<description><![CDATA[With recent horror stories of Google users getting locked out of their accounts floating around the Internet, it makes you reconsider putting so much trust in Google. A lot of people have all their eggs in the Google basket, but they could too be locked out at any given time. Gmail could also go down [...]]]></description>
			<content:encoded><![CDATA[<p>With recent horror stories of Google users getting <a href="http://www.chrisbrogan.com/when-google-owns-you/">locked out of their accounts</a> floating around the Internet, it makes you reconsider putting so much trust in Google. A lot of people have all their eggs in the Google basket, but they could too be locked out at any given time. Gmail could also go down or lose some of your email when you need it most. Here&#8217;s a method for archiving all your email to a local machine using a Gmail account and a POP3 email client.</p>
<p><a href="http://mark.bockenstedt.net/wp-content/uploads/2008/11/diagram.png"><img class="alignnone size-medium wp-image-491" title="Workflow" src="http://mark.bockenstedt.net/wp-content/uploads/2008/11/diagram-300x293.png" alt="" width="180" height="176" /></a></p>
<p><span id="more-484"></span></p>
<p><strong>1. Create a Gateway Email Account</strong></p>
<p>I call this a gateway account because all your archived email will pass through this account. If you&#8217;ve already got one, make sure you can dedicate it to this sole purpose. If not, head over to <a href="http://www.gmail.com/">Gmail</a> and sign up for an account. Once you&#8217;ve got the account set up, we can start forwarding email to it.</p>
<p><strong>2. Gathering Email</strong></p>
<p>There are two ways to accomplish this and both methods are outlined assuming you&#8217;re getting email from another Gmail account (Google Apps for Your Domain works this way too). Method A involves forwarding a copy of your email to your gateway account; Method B involves grabbing email using POP3 from your gateway account.</p>
<p><strong>a. Forwarding Email</strong></p>
<p>This is pretty straight forward. Go into each of the Gmail accounts you wish to forward email from and click on the Settings link in the upper right, then click on the <em>Forwarding and POP/IMAP</em> tab. Check the radio button next to &#8220;Forward a copy&#8221; and then enter the address for your gateway account. You&#8217;ll probably want to select <em>keep Gmail&#8217;s copy in the inbox</em>, especially if you intend on using the address. When you&#8217;re finished, click <em>Save Changes</em>.</p>
<p><a href="http://mark.bockenstedt.net/wp-content/uploads/2008/11/gmail-forwarding.jpg"><img class="alignnone size-full wp-image-487" title="Forward Settings" src="http://mark.bockenstedt.net/wp-content/uploads/2008/11/gmail-forwarding.jpg" alt="" width="500" height="77" /></a></p>
<p><strong>b. Popping Email</strong></p>
<p>Gmail has directions on <a href="http://mail.google.com/support/bin/answer.py?answer=13273&amp;topic=13293">enabling POP</a> for your archive accounts, which is just step one. The beauty of this method is that you can set this up for any account that supports POP, which is just about every email service on the planet. Even if you&#8217;re not using Gmail, you can employ similar techniques to get this working.</p>
<p><a href="http://mark.bockenstedt.net/wp-content/uploads/2008/11/gmail-pop.jpg"><img class="alignnone size-full wp-image-488" title="POP Settings" src="http://mark.bockenstedt.net/wp-content/uploads/2008/11/gmail-pop.jpg" alt="" width="400" height="88" /></a></p>
<p>Once you&#8217;ve enabled POP for your account, you can start pulling email from up to five accounts into your gateway account. Again, Google has directions on <a href="http://mail.google.com/support/bin/answer.py?answer=21289">enabling Mail Fetcher</a>, so check those out.</p>
<p><a href="http://mark.bockenstedt.net/wp-content/uploads/2008/11/gmail-pop-accounts.jpg"><img class="alignnone size-full wp-image-489" title="Gmail POP Accounts" src="http://mark.bockenstedt.net/wp-content/uploads/2008/11/gmail-pop-accounts.jpg" alt="" width="329" height="62" /></a></p>
<p><strong>3. Setting Up the Email Client</strong></p>
<p>There are a ton of applications you can use to do this, but I recommend using <a href="http://www.mozilla.com/thunderbird">Mozilla Thunderbird</a> (it&#8217;s free, fast, and just good). The basic idea is to set up Thunderbird to grab copies of email from your gateway account &#8211; and subsequently all other accounts funneled into it &#8211; and store them locally. Google already has good <a href="http://mail.google.com/support/bin/answer.py?answer=38343">directions</a> on how to do this, so I won&#8217;t reinvent the wheel.</p>
<p>Some tips for setting up your POP3 client are to make sure you enable POP for all mail and keep Gmail&#8217;s copy in the inbox (just in case). If you&#8217;re funneling high volumes of email into your gateway, you&#8217;ll want to keep an eye on your gateway&#8217;s disk quota so you don&#8217;t go over the limit. You could also tell Gmail to remove the server&#8217;s copy once you download it. After you do that, you can proceed with setting up Thunderbird.</p>
<p>FYI &#8211; You can also do this with <a href="http://mail.google.com/support/bin/answer.py?answer=13275">Apple Mail 3.0</a>, <a href="http://mail.google.com/support/bin/answer.py?answer=13276">Outlook Express</a>, <a href="http://mail.google.com/support/bin/answer.py?answer=13278">Outlook 2003</a>, <a href="http://mail.google.com/support/bin/answer.py?answer=86373">Outlook 2007</a>, or <a href="http://mail.google.com/support/bin/answer.py?answer=86382">Windows Mail</a>.</p>
<p><strong>4. Safely Storing the Archive</strong></p>
<p>The final step is to make sure you&#8217;re storing the archive somewhere safe. If you trust your computer, you can just leave it as is. But, the whole point of this article is having a backup, so I recommend putting a copy of the email archive somewhere safe, such as <a href="https://www.getdropbox.com/">Dropbox</a>. Any cloud storage solution will work and most offer around 2GB of storage, which should be plenty. You can also use an old-fashioned CD or thumb drive if you so desire.</p>
<p>To grab the mail archive from Thunderbird, you need to find your profile folder. This folder is generally a hidden folder, so you&#8217;ll need to unhide folders temporarily if you&#8217;ve got them hidden. The x characters below will be a random string, so don&#8217;t actually look for xxxxxxxx.default.</p>
<ul>
<li>In XP, go to C:\Documents and Settings\[User]\Application Data\Thunderbird\Profiles\xxxxxxxx.default\</li>
<li>In Vista, go to C:\Users\[User]\AppData\Local\Thunderbird\Profiles\xxxxxxxx.default\</li>
<li>In Leopard, go to ~/Library/Thunderbird/Profiles/xxxxxxxx.default/</li>
<li>In Ubuntu, go to ~/.thunderbird/xxxxxxxx.default/</li>
</ul>
<p>Your safest bet is to copy the entire profile folder to ensure you get everything. Once you&#8217;ve got that, throw it into your Dropbox in a folder named <em>email_backup</em> or something similarly indicative of its contents. Keep in mind the folders you&#8217;ll put into Dropbox are cumulative, meaning they&#8217;ll contain all the email that Thunderbird knows about.</p>
<p><strong>5. Automate</strong></p>
<p>Well, this isn&#8217;t really automation in the true spirit, but you can leave your Thunderbird running in the background grabbing email every 5 or so minutes. Then, you can set up automatic exports in Linux or OS X to copy your backup into your Dropbox. I don&#8217;t have advice on how to do that in anything other than Linux, so I&#8217;ll skip this step. Just be aware that it&#8217;s possible.</p>
<p><strong>All your email are belong to you&#8230;</strong></p>
<p>That&#8217;s it, 5 simple steps to backing up your email. Look for an article soon on importing email to Thunderbird from this backup. I&#8217;ll also be covering a similar solution using <a href="http://www.gmail-backup.com/">Gmail Backup</a> which will use a lot of the same techniques, but will omit the use of Thunderbird.</p>
<h3  class="related_post_title"><h2>Related Posts</h2></h3><ul class="related_post"><li><a href="http://mark.bockenstedt.net/2008/11/05/backup-your-gmail-with-gmail-backup/" title="Backup Your Gmail With&#8230; Gmail Backup">Backup Your Gmail With&#8230; Gmail Backup</a></li><li><a href="http://mark.bockenstedt.net/2008/10/31/google-alerts-rss-style/" title="Google Alerts, RSS Style">Google Alerts, RSS Style</a></li><li><a href="http://mark.bockenstedt.net/2008/09/23/creating-a-fluid-based-google-reader-app/" title="Creating a Fluid-Based Google Reader App">Creating a Fluid-Based Google Reader App</a></li><li><a href="http://mark.bockenstedt.net/2008/09/22/laconica-xmpp-sms-oh-my/" title="Laconica, XMPP, SMS, Oh My!">Laconica, XMPP, SMS, Oh My!</a></li><li><a href="http://mark.bockenstedt.net/2008/08/24/noise-filtering-on-google-search-results/" title="Noise Filtering on Google Search Results">Noise Filtering on Google Search Results</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://mark.bockenstedt.net/2008/11/04/how-to-use-gmail-as-an-email-backup-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Laconica, XMPP, SMS, Oh My!</title>
		<link>http://mark.bockenstedt.net/2008/09/22/laconica-xmpp-sms-oh-my/</link>
		<comments>http://mark.bockenstedt.net/2008/09/22/laconica-xmpp-sms-oh-my/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 15:15:00 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Laconica]]></category>
		<category><![CDATA[SMS]]></category>
		<category><![CDATA[XMPP]]></category>

		<guid isPermaLink="false">http://mark.bockenstedt.net/?p=399</guid>
		<description><![CDATA[Last Monday&#8217;s post was a bunch of directions on how to install Laconica on your own server. What the directions failed to mention was how to set up the good stuff &#8211; XMPP, SMS, and posting via email. Today I&#8217;ll go over how to get XMPP and SMS running. SMS Populate carriers table If you [...]]]></description>
			<content:encoded><![CDATA[<p>Last Monday&#8217;s post was a bunch of directions on <a href="http://mark.bockenstedt.net/2008/09/15/how-to-install-laconica/">how to install Laconica</a> on your own server. What the directions failed to mention was how to set up the good stuff &#8211; XMPP, SMS, and posting via email. Today I&#8217;ll go over how to get XMPP and SMS running.</p>
<h3>SMS</h3>
<p><strong>Populate carriers table</strong></p>
<p>If you look in the db folder, you&#8217;ll find a file called carrier.sql. If you run that against the laconica database you created for the install, all the providers in the file (58 in all) will be available to select in the SMS tab of your instance. I actually reduce the number to 16 because most of them are international services.</p>
<p>How SMS works is the Laconica server will fire off an email to your carrier&#8217;s gateway, which then should be delivered as an SMS. Not all carriers play well with this (I&#8217;m looking at you, US Cellular) so your mileage may vary in terms of results. I&#8217;ve already got a confirmation that AT&amp;T works.</p>
<p>If carriers are missing from the table and you know the carrier&#8217;s gateway, it&#8217;s really easy to add them to the options. Simply create a new record in the sms_carrier table and fill in the name and email pattern.</p>
<p><strong>Try it out</strong></p>
<p>Head to the Settings -&gt; SMS tab of your instance, enter your phone number, select your carrier, and hit the Add button. You should receive an SMS with a confirmation code, which you&#8217;ll have to enter in the new box that appears. Once you do that, your phone should be prime for receiving SMS to your phone.</p>
<p><strong>SMS is one-way</strong></p>
<p>What I mean by that is you can only receive notifications through SMS &#8211; you can&#8217;t post updates to the service (yet). This simplifies matters because admins won&#8217;t have to worry about setting up all the SMS inbound boxes and all that. For now, this will work.</p>
<h3>XMPP</h3>
<p>This is where things get ugly. If you&#8217;ve already got a Jabber/XMPP server, you&#8217;re golden. If not&#8230; get one.</p>
<p><strong>Configuration</strong></p>
<p><em>If you already have an XMPP server, you can do this now. Otherwise, install one and come back to this.</em></p>
<p>Head back to the trusty config.php file and scroll down to the XMPP section and you&#8217;ll find a plethora of options regarding XMPP. If you have a server, fill in the appropriate values and you should be good to go.</p>
<p><strong>Choosing a Server<br />
</strong></p>
<p>You can probably use whatever server you want to for this, provided it does the job. I chose to use Openfire, a bloated Java server. Frankly, I had no reasons behind the choice other than it worked after some configuration. All directions henceforth will be specific to Openfire.</p>
<p><strong>Installation</strong></p>
<p>Before I jump into the juicy details, bookmark the <a href="http://www.igniterealtime.org/projects/openfire/documentation.jsp" target="_blank">Openfire Documentation</a> page. It will become your best friend.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> sun-java6-bin sun-java6-jre sun-java6-jdk
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>opt
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.igniterealtime.org<span style="color: #000000; font-weight: bold;">/</span>downloadServlet?<span style="color: #007800;">filename</span>=openfire<span style="color: #000000; font-weight: bold;">/</span>openfire_3_6_0a.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xzvf</span> downloadServlet?<span style="color: #007800;">filename</span>=openfire<span style="color: #000000; font-weight: bold;">/</span>openfire_3_6_0a.tar.gz</pre></div></div>

<p>The next step is to set up the database. I&#8217;m going to assume you&#8217;re using MySQL, but you can use any of the following: DB2, HSQLDB, MySQL, Oracle, PostgreSQL, SQLServer, or SyBase. I&#8217;ll also assume you&#8217;ve created a database to hold Openfire info (database named openfire).</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>openfire<span style="color: #000000; font-weight: bold;">/</span>resources<span style="color: #000000; font-weight: bold;">/</span>database
mysql <span style="color: #660033;">-u</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>db_user<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #660033;">-p</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>db_pass<span style="color: #7a0874; font-weight: bold;">&#93;</span> openfire <span style="color: #000000; font-weight: bold;">&amp;</span>lt; openfire_mysql.sql</pre></div></div>

<p><strong>Start Server</strong></p>
<p>Now it&#8217;s time to kick this bad boy off and see if it works:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>openfire
.<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>openfire start</pre></div></div>

<p>If it complains of not being able to find a JVM, try doing this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> update-alternatives <span style="color: #660033;">--config</span> java</pre></div></div>

<p>and select a different JVM. The JVM installed from above is at <code>/usr/lib/jvm/java-6-sun/jre/bin/java</code> so that&#8217;s what I selected. I have no idea if that impacts the rest of the system at all.<br />
OK, so now your server should be running. Time to set it up.</p>
<p><strong>Setup</strong></p>
<p>If you were able to run the server without incident, point your browser to port 9090 on the server you installed Openfire on. Follow the on-screen prompts. I screwed the pooch and didn&#8217;t take screenshots of the process.</p>
<p><strong>Create an update user</strong></p>
<p>Go into the Users/Groups page in your Openfire Admin Console (OAC) and create a new user and give it a password. I named my user update, but the name is arbitrary.</p>
<p><strong>Update the Laconica config</strong></p>
<p>If you&#8217;re just installing an XMPP server, you need to make sure to tell Laconica about your new Openfire user. Here&#8217;s what my XMPP config looks like:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'xmpp'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'enabled'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'xmpp'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'host'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'bockenstedt.net'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'xmpp'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'server'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'bockenstedt.net'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'xmpp'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'port'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">5222</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'xmpp'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'user'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'update'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'xmpp'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'encryption'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'xmpp'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'resource'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'xmpphp'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'xmpp'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'xmpp'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'public'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'imbuddy@bockenstedt.net'</span><span style="color: #339933;">;</span></pre></div></div>

<p>Simply change the above fields where appropriate and Laconica should be informed about your XMPP buddy. I dont&#8217; know what the last line is for, so if anyone can clue me in, please do via a comment or email. If you look now, your update user should be offline in the OAC.</p>
<p><strong>Unleash the daemons</strong></p>
<p>This is the step that tripped me up. In the scripts directory there are a number of handlers and daemons that need to be running in order for everything to work properly. There&#8217;s also a handy little shell script that executes all the necessary daemons. You can run all the daemons at once by typing:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>startdaemons.sh</pre></div></div>

<p>For some reason, I got errors when the script tried to open the files so I just started the daemons manually.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">php xmppdaemon.php
php jabberqueuehandler.php
php publicqueuehandler.php
php xmppconfirmhandler.php
php smsqueuehandler.php
php ombqueuehandler.php</pre></div></div>

<p>That should do it for getting the daemons running. If you look in your OAC again, your update user should be online.</p>
<p><strong>Open ports</strong></p>
<p>The final step is to open a few ports to outside access so users can communicate with your XMPP server. You need to open 5222, 5223, and 5296 for traffic to flow properly. If you&#8217;re going to need OAC access outside of your firewall, you have to open port 9090.</p>
<p><strong>Caveats</strong></p>
<p>Using the above methods, I was able to connect my Gmail account with the XMPP server and send updates successfully. However, another user who is using an afilliate Google account (ie john@doe.com signed up through Gmail) was unable to connect to the server.</p>
<h3  class="related_post_title"><h2>Related Posts</h2></h3><ul class="related_post"><li><a href="http://mark.bockenstedt.net/2008/11/05/backup-your-gmail-with-gmail-backup/" title="Backup Your Gmail With&#8230; Gmail Backup">Backup Your Gmail With&#8230; Gmail Backup</a></li><li><a href="http://mark.bockenstedt.net/2008/11/04/how-to-use-gmail-as-an-email-backup-service/" title="How To Use Gmail as an Email Backup Service">How To Use Gmail as an Email Backup Service</a></li><li><a href="http://mark.bockenstedt.net/2008/09/15/how-to-install-laconica/" title="How To Install Laconica">How To Install Laconica</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://mark.bockenstedt.net/2008/09/22/laconica-xmpp-sms-oh-my/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
