<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: A practical example of mboxmerge</title>
	<atom:link href="http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/</link>
	<description>Paul Betts's personal website / blog / what-have-you</description>
	<lastBuildDate>Wed, 26 May 2010 09:57:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
	<item>
		<title>By: JoanCodina</title>
		<link>http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/comment-page-1/#comment-17159</link>
		<dc:creator>JoanCodina</dc:creator>
		<pubDate>Tue, 27 Jan 2009 15:35:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/#comment-17159</guid>
		<description>There is an error in your script,
the way you cut the mail file into mails is correct as the format indicates that a mail starts by &quot;Form &quot;
but inside a mail there can be many lines starting by 
&quot;From:&quot; &quot;To:&quot; or &quot;Date:&quot; in particular, when there is a forward, the header of the forwarded message has this data.
so, i changed it a bit (i never programmed in ruby before so... what i do so to check only the first from, to or date...

def MboxMessage.parse(lines)
		ret = MboxMessage.new
		ret.message_with_headers = lines.join(&quot;&quot;)
		in_message = false
		md5 = Digest::MD5.new
		@uniq &#124;&#124;= 0
		@uniq = @uniq + 1
		from = to = subject = nil
		lines.each do &#124;s&#124;
			in_message &#124;= (s.length == 0)
			if in_message
				md5 &lt;&lt; s
				next
			end
			# Pick up some of the header data
			if from  == nil  
				from = $1 if s =~ /^From: (.*)$/
              end
			if to  == nil  
			   to = $1 if s =~ /^To: (.*)$/
			end
			if subject  == nil  
				subject = $1 if s =~ /^Subject: (.*)$/
            end
	        begin
				if !ret.message_time and s =~ /^Date: (.*)$/
					ret.message_time = parsedate_to_time(ParseDate.parsedate($1))
				end
			rescue Exception
				STDERR &lt;&lt; &#039;error with date &#039; + $1 + &#039; in mail from &#039;+ from + &#039;to:&#039;+ to + &#039;subject:&#039;+ subject+&quot;\n&quot;
				raise  
			end
        end</description>
		<content:encoded><![CDATA[<p>There is an error in your script,<br />
the way you cut the mail file into mails is correct as the format indicates that a mail starts by &#8220;Form &#8221;<br />
but inside a mail there can be many lines starting by<br />
&#8220;From:&#8221; &#8220;To:&#8221; or &#8220;Date:&#8221; in particular, when there is a forward, the header of the forwarded message has this data.<br />
so, i changed it a bit (i never programmed in ruby before so&#8230; what i do so to check only the first from, to or date&#8230;</p>
<p>def MboxMessage.parse(lines)<br />
		ret = MboxMessage.new<br />
		ret.message_with_headers = lines.join(&#8220;&#8221;)<br />
		in_message = false<br />
		md5 = Digest::MD5.new<br />
		@uniq ||= 0<br />
		@uniq = @uniq + 1<br />
		from = to = subject = nil<br />
		lines.each do |s|<br />
			in_message |= (s.length == 0)<br />
			if in_message<br />
				md5 &lt;&lt; s<br />
				next<br />
			end<br />
			# Pick up some of the header data<br />
			if from  == nil<br />
				from = $1 if s =~ /^From: (.*)$/<br />
              end<br />
			if to  == nil<br />
			   to = $1 if s =~ /^To: (.*)$/<br />
			end<br />
			if subject  == nil<br />
				subject = $1 if s =~ /^Subject: (.*)$/<br />
            end<br />
	        begin<br />
				if !ret.message_time and s =~ /^Date: (.*)$/<br />
					ret.message_time = parsedate_to_time(ParseDate.parsedate($1))<br />
				end<br />
			rescue Exception<br />
				STDERR &lt;&lt; &#8216;error with date &#8216; + $1 + &#8216; in mail from &#8216;+ from + &#8216;to:&#8217;+ to + &#8216;subject:&#8217;+ subject+&#8221;\n&#8221;<br />
				raise<br />
			end<br />
        end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl-Heinz</title>
		<link>http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/comment-page-1/#comment-8097</link>
		<dc:creator>Karl-Heinz</dc:creator>
		<pubDate>Sat, 05 Apr 2008 16:25:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/#comment-8097</guid>
		<description>Paul. Thanks a lot for sharing this nice program with all of us. I try to sync my laptop with my desktop just like Guilf. Did not start so far, but read all comments carefully. 
Just a hint. At the moment I used the Thunderbird Add-on  &quot;Attachment extractor&quot; to remove the attachments. This makes my Inbox much smaller. 

Next step will be to use the windows version of your program. 

Thanks again

Karl-Heinz</description>
		<content:encoded><![CDATA[<p>Paul. Thanks a lot for sharing this nice program with all of us. I try to sync my laptop with my desktop just like Guilf. Did not start so far, but read all comments carefully.<br />
Just a hint. At the moment I used the Thunderbird Add-on  &#8220;Attachment extractor&#8221; to remove the attachments. This makes my Inbox much smaller. </p>
<p>Next step will be to use the windows version of your program. </p>
<p>Thanks again</p>
<p>Karl-Heinz</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: guilf</title>
		<link>http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/comment-page-1/#comment-7633</link>
		<dc:creator>guilf</dc:creator>
		<pubDate>Sun, 09 Mar 2008 15:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/#comment-7633</guid>
		<description>Paul, sorry, thanks. I&#039;ve looked through all spam messages but can&#039;t find it. Would you mind re-mailing with the white list filter word tetra somewhere in the subject line?

Thank you very much for your help in this.</description>
		<content:encoded><![CDATA[<p>Paul, sorry, thanks. I&#8217;ve looked through all spam messages but can&#8217;t find it. Would you mind re-mailing with the white list filter word tetra somewhere in the subject line?</p>
<p>Thank you very much for your help in this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Betts</title>
		<link>http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/comment-page-1/#comment-7603</link>
		<dc:creator>Paul Betts</dc:creator>
		<pubDate>Sat, 08 Mar 2008 03:03:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/#comment-7603</guid>
		<description>@guilf: Yes, I sent you a fixed version already - check your spam box!</description>
		<content:encoded><![CDATA[<p>@guilf: Yes, I sent you a fixed version already &#8211; check your spam box!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: guilf</title>
		<link>http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/comment-page-1/#comment-7599</link>
		<dc:creator>guilf</dc:creator>
		<pubDate>Fri, 07 Mar 2008 20:50:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/#comment-7599</guid>
		<description>Any progress, Paul?</description>
		<content:encoded><![CDATA[<p>Any progress, Paul?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: guilf</title>
		<link>http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/comment-page-1/#comment-7428</link>
		<dc:creator>guilf</dc:creator>
		<pubDate>Fri, 29 Feb 2008 03:40:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/#comment-7428</guid>
		<description>in case it helps, here&#039;s the output of another attempt at a merge:

Inbox                                         100%   49MB   2.1MB/s   00:23    
&#039; has no date!
&#039;&#039; has no date!
&#039;&#039; has no date!
/home/steve/.mboxmerge/mboxmerge.rb:49:in `mktime&#039;: argument out of range (ArgumentError)
        from /home/steve/.mboxmerge/mboxmerge.rb:49:in `parsedate_to_time&#039;
        from /home/steve/.mboxmerge/mboxmerge.rb:77:in `parse&#039;
        from /home/steve/.mboxmerge/mboxmerge.rb:65:in `each&#039;
        from /home/steve/.mboxmerge/mboxmerge.rb:65:in `parse&#039;
        from /home/steve/.mboxmerge/mboxmerge.rb:119
        from /home/steve/.mboxmerge/mboxmerge.rb:117:in `each&#039;
        from /home/steve/.mboxmerge/mboxmerge.rb:117
        from /home/steve/.mboxmerge/mboxmerge.rb:115:in `each&#039;
        from /home/steve/.mboxmerge/mboxmerge.rb:115
1658 messages on steve-desktop
15 messages on local
0 messages in merged mailbox</description>
		<content:encoded><![CDATA[<p>in case it helps, here&#8217;s the output of another attempt at a merge:</p>
<p>Inbox                                         100%   49MB   2.1MB/s   00:23<br />
&#8216; has no date!<br />
&#8221; has no date!<br />
&#8221; has no date!<br />
/home/steve/.mboxmerge/mboxmerge.rb:49:in `mktime&#8217;: argument out of range (ArgumentError)<br />
        from /home/steve/.mboxmerge/mboxmerge.rb:49:in `parsedate_to_time&#8217;<br />
        from /home/steve/.mboxmerge/mboxmerge.rb:77:in `parse&#8217;<br />
        from /home/steve/.mboxmerge/mboxmerge.rb:65:in `each&#8217;<br />
        from /home/steve/.mboxmerge/mboxmerge.rb:65:in `parse&#8217;<br />
        from /home/steve/.mboxmerge/mboxmerge.rb:119<br />
        from /home/steve/.mboxmerge/mboxmerge.rb:117:in `each&#8217;<br />
        from /home/steve/.mboxmerge/mboxmerge.rb:117<br />
        from /home/steve/.mboxmerge/mboxmerge.rb:115:in `each&#8217;<br />
        from /home/steve/.mboxmerge/mboxmerge.rb:115<br />
1658 messages on steve-desktop<br />
15 messages on local<br />
0 messages in merged mailbox</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: guilf</title>
		<link>http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/comment-page-1/#comment-7411</link>
		<dc:creator>guilf</dc:creator>
		<pubDate>Thu, 28 Feb 2008 14:23:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/#comment-7411</guid>
		<description>Thanks! That would be great, Paul!</description>
		<content:encoded><![CDATA[<p>Thanks! That would be great, Paul!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Betts</title>
		<link>http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/comment-page-1/#comment-7405</link>
		<dc:creator>Paul Betts</dc:creator>
		<pubDate>Thu, 28 Feb 2008 06:38:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/#comment-7405</guid>
		<description>@guilf: I&#039;ll try to hack in a fix to the dates problem - I&#039;ll let you know about it.</description>
		<content:encoded><![CDATA[<p>@guilf: I&#8217;ll try to hack in a fix to the dates problem &#8211; I&#8217;ll let you know about it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: guilf</title>
		<link>http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/comment-page-1/#comment-7404</link>
		<dc:creator>guilf</dc:creator>
		<pubDate>Thu, 28 Feb 2008 06:35:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/#comment-7404</guid>
		<description>Well it worked for a few folders but not for others -- I had one with a limited number of messages,  all seemed to have proper dates and times, but the folder wouldn&#039;t merge with similar argument out of range errors.

I also found that though the backslash worked for the remote folder names, it didn&#039;t work for the local folder names. Odd---

I reverted the local &quot;Local\ Folders&quot; to &quot;Local_Folders&quot; and the locations were then accepted. 

I left the remote one as &quot;Local\ Folders&quot;

So, as it stands now, unless there&#039;s a way of determining what is wrong or &quot;out of range,&quot; the code doesn&#039;t work reliably enough in Firefox at least to be usable.

If I knew what was wrong with the mail folder I&#039;d try to correct it.</description>
		<content:encoded><![CDATA[<p>Well it worked for a few folders but not for others &#8212; I had one with a limited number of messages,  all seemed to have proper dates and times, but the folder wouldn&#8217;t merge with similar argument out of range errors.</p>
<p>I also found that though the backslash worked for the remote folder names, it didn&#8217;t work for the local folder names. Odd&#8212;</p>
<p>I reverted the local &#8220;Local\ Folders&#8221; to &#8220;Local_Folders&#8221; and the locations were then accepted. </p>
<p>I left the remote one as &#8220;Local\ Folders&#8221;</p>
<p>So, as it stands now, unless there&#8217;s a way of determining what is wrong or &#8220;out of range,&#8221; the code doesn&#8217;t work reliably enough in Firefox at least to be usable.</p>
<p>If I knew what was wrong with the mail folder I&#8217;d try to correct it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: guilf</title>
		<link>http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/comment-page-1/#comment-7372</link>
		<dc:creator>guilf</dc:creator>
		<pubDate>Tue, 26 Feb 2008 22:45:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.paulbetts.org/index.php/2007/02/15/a-practical-example-of-mboxmerge/#comment-7372</guid>
		<description>Okay, continuing to experiment:

1.) The large mail file was split up into smaller folders. Exactly the same error messages appeared in attempting to merge the original folder (Inbox) no matter what the contents or size

2.) The original folder had subfolders. These were moved out of the Inbox folder into their own folders. Running MBoxMerge was successful! There were a few running notes of files without dates, but a merge folder was generated (iunlike before)

3.) Conclusion: in Thunderbird, there are probably pointers to subfolders in any mail folder. These confuse MBoxMerge. A current workaround may be to eliminate subfolders, and if a folder organization is required, simply make all folders equivalent in position. That would mean, in a default Thunderbird installation, all folders are subfolders of &quot;Local Folders&quot;.

I&#039;m not sure how Evolution handles subfolders so this may not apply there.</description>
		<content:encoded><![CDATA[<p>Okay, continuing to experiment:</p>
<p>1.) The large mail file was split up into smaller folders. Exactly the same error messages appeared in attempting to merge the original folder (Inbox) no matter what the contents or size</p>
<p>2.) The original folder had subfolders. These were moved out of the Inbox folder into their own folders. Running MBoxMerge was successful! There were a few running notes of files without dates, but a merge folder was generated (iunlike before)</p>
<p>3.) Conclusion: in Thunderbird, there are probably pointers to subfolders in any mail folder. These confuse MBoxMerge. A current workaround may be to eliminate subfolders, and if a folder organization is required, simply make all folders equivalent in position. That would mean, in a default Thunderbird installation, all folders are subfolders of &#8220;Local Folders&#8221;.</p>
<p>I&#8217;m not sure how Evolution handles subfolders so this may not apply there.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

