<?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: How to Migrate Emails from Maildir to Gmail</title>
	<atom:link href="http://scott.yang.id.au/2009/01/migrate-emails-maildir-gmail/feed/" rel="self" type="application/rss+xml" />
	<link>http://scott.yang.id.au/2009/01/migrate-emails-maildir-gmail/</link>
	<description>Faith, Technology and Randomness in Life, According to Scott</description>
	<lastBuildDate>Wed, 08 Feb 2012 13:17:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: ehowland</title>
		<link>http://scott.yang.id.au/2009/01/migrate-emails-maildir-gmail/#comment-102823</link>
		<dc:creator>ehowland</dc:creator>
		<pubDate>Tue, 07 Feb 2012 17:05:30 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/?p=1862#comment-102823</guid>
		<description>I have also had problems with the mail looking like it is going but not appearing on gmail.  Here are some of my tips.  I am using a nonprofit google apps account so I had a different domain name. 

1.  I took out the [Gmail] on line 23
&lt;code&gt;
            self.folder = &#039;[Gmail]/%s&#039; % self.folder
becomes:
            self.folder = &#039;%s&#039; % self.folder
&lt;/code&gt;

2. I found I had to create the labels before the script ran, otherwise the mail would not appear. 

3.  I believe putting the password in double quotes killed a few runs

4. This was timing out so I used nohup to keep it running. 

So my line looks something like:

&lt;code&gt;
nohup python maildir2gmail.py -f &quot;meeting_notes&quot; -u btest@example.com -p gmail_password &quot;Maildir/.meeting notes/cur&quot;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I have also had problems with the mail looking like it is going but not appearing on gmail.  Here are some of my tips.  I am using a nonprofit google apps account so I had a different domain name. </p>
<p>1.  I took out the [Gmail] on line 23<br />
<code><br />
            self.folder = '[Gmail]/%s' % self.folder<br />
becomes:<br />
            self.folder = '%s' % self.folder<br />
</code></p>
<p>2. I found I had to create the labels before the script ran, otherwise the mail would not appear. </p>
<p>3.  I believe putting the password in double quotes killed a few runs</p>
<p>4. This was timing out so I used nohup to keep it running. </p>
<p>So my line looks something like:</p>
<p><code><br />
nohup python maildir2gmail.py -f "meeting_notes" -u <a href="mailto:btest@example.com">btest@example.com</a> -p gmail_password "Maildir/.meeting notes/cur"<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dagda</title>
		<link>http://scott.yang.id.au/2009/01/migrate-emails-maildir-gmail/#comment-102741</link>
		<dc:creator>Dagda</dc:creator>
		<pubDate>Mon, 19 Dec 2011 15:30:01 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/?p=1862#comment-102741</guid>
		<description>Hi,

 I tried running your script. It seems to execute OK, but like a few others that have previously posted, I don&#039;t see the emails in my gmail account. 

 I&#039;m attempting to import the emails to my personal gmail account. It&#039;s not a gmail app / business account. Not sure if that makes a difference...

 I see different people had success by editing some values in your script. I tried all permutations with no luck.

 I used telnet-ssl to connect manually to the gmail imap server and execute the list command. Here&#039;s what I get...

* LIST (\HasNoChildren) &quot;/&quot; &quot;Archived&quot;
* LIST (\HasNoChildren) &quot;/&quot; &quot;INBOX&quot;
* LIST (\HasNoChildren) &quot;/&quot; &quot;Receipts&quot;
* LIST (\HasNoChildren) &quot;/&quot; &quot;Subscriptions&quot;
* LIST (\HasNoChildren) &quot;/&quot; &quot;Sun&quot;
* LIST (\Noselect \HasChildren) &quot;/&quot; &quot;[Gmail]&quot;
* LIST (\HasNoChildren) &quot;/&quot; &quot;[Gmail]/All Mail&quot;
* LIST (\HasChildren \HasNoChildren) &quot;/&quot; &quot;[Gmail]/Bin&quot;
* LIST (\HasChildren \HasNoChildren) &quot;/&quot; &quot;[Gmail]/Drafts&quot;
* LIST (\HasNoChildren) &quot;/&quot; &quot;[Gmail]/Important&quot;
* LIST (\HasChildren \HasNoChildren) &quot;/&quot; &quot;[Gmail]/Sent Mail&quot;
* LIST (\HasChildren \HasNoChildren) &quot;/&quot; &quot;[Gmail]/Spam&quot;
* LIST (\HasNoChildren) &quot;/&quot; &quot;[Gmail]/Starred&quot;
a2 OK Success

 Based on the information here, should I update the python script to get it to work?

 If I try to import mails in a folder, must that folder already exists in my gmail account or will it be automatically created?

 Any help appreciated...</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p> I tried running your script. It seems to execute OK, but like a few others that have previously posted, I don&#8217;t see the emails in my gmail account. </p>
<p> I&#8217;m attempting to import the emails to my personal gmail account. It&#8217;s not a gmail app / business account. Not sure if that makes a difference&#8230;</p>
<p> I see different people had success by editing some values in your script. I tried all permutations with no luck.</p>
<p> I used telnet-ssl to connect manually to the gmail imap server and execute the list command. Here&#8217;s what I get&#8230;</p>
<p>* LIST (\HasNoChildren) &#8220;/&#8221; &#8220;Archived&#8221;<br />
* LIST (\HasNoChildren) &#8220;/&#8221; &#8220;INBOX&#8221;<br />
* LIST (\HasNoChildren) &#8220;/&#8221; &#8220;Receipts&#8221;<br />
* LIST (\HasNoChildren) &#8220;/&#8221; &#8220;Subscriptions&#8221;<br />
* LIST (\HasNoChildren) &#8220;/&#8221; &#8220;Sun&#8221;<br />
* LIST (\Noselect \HasChildren) &#8220;/&#8221; &#8220;[Gmail]&#8221;<br />
* LIST (\HasNoChildren) &#8220;/&#8221; &#8220;[Gmail]/All Mail&#8221;<br />
* LIST (\HasChildren \HasNoChildren) &#8220;/&#8221; &#8220;[Gmail]/Bin&#8221;<br />
* LIST (\HasChildren \HasNoChildren) &#8220;/&#8221; &#8220;[Gmail]/Drafts&#8221;<br />
* LIST (\HasNoChildren) &#8220;/&#8221; &#8220;[Gmail]/Important&#8221;<br />
* LIST (\HasChildren \HasNoChildren) &#8220;/&#8221; &#8220;[Gmail]/Sent Mail&#8221;<br />
* LIST (\HasChildren \HasNoChildren) &#8220;/&#8221; &#8220;[Gmail]/Spam&#8221;<br />
* LIST (\HasNoChildren) &#8220;/&#8221; &#8220;[Gmail]/Starred&#8221;<br />
a2 OK Success</p>
<p> Based on the information here, should I update the python script to get it to work?</p>
<p> If I try to import mails in a folder, must that folder already exists in my gmail account or will it be automatically created?</p>
<p> Any help appreciated&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pete</title>
		<link>http://scott.yang.id.au/2009/01/migrate-emails-maildir-gmail/#comment-102715</link>
		<dc:creator>Pete</dc:creator>
		<pubDate>Tue, 06 Dec 2011 06:41:21 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/?p=1862#comment-102715</guid>
		<description>Ok, answered my own silly question - just escape all the characters special to python.  If you&#039;re not sure what they are, do:

PWDFORPYTHON=yourcrazypassword
echo $PWDFORPYTHON

Except use the \ character to escape anything you think is a problem in &#039;yourcrazypassword&#039; eg your\`crazy\!pass\)word escapes the `, !, and ) characters.  If the echo statement doesn&#039;t reproduce your actual password perfectly, then you&#039;ve missed an escape - fix and repeat until it&#039;s correct.  Then do:

python -u yourusername -p $PWDFORPYTHON [and whatever else you were going to type here]</description>
		<content:encoded><![CDATA[<p>Ok, answered my own silly question &#8211; just escape all the characters special to python.  If you&#8217;re not sure what they are, do:</p>
<p>PWDFORPYTHON=yourcrazypassword<br />
echo $PWDFORPYTHON</p>
<p>Except use the \ character to escape anything you think is a problem in &#8216;yourcrazypassword&#8217; eg your\`crazy\!pass\)word escapes the `, !, and ) characters.  If the echo statement doesn&#8217;t reproduce your actual password perfectly, then you&#8217;ve missed an escape &#8211; fix and repeat until it&#8217;s correct.  Then do:</p>
<p>python -u yourusername -p $PWDFORPYTHON [and whatever else you were going to type here]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pete</title>
		<link>http://scott.yang.id.au/2009/01/migrate-emails-maildir-gmail/#comment-102714</link>
		<dc:creator>Pete</dc:creator>
		<pubDate>Tue, 06 Dec 2011 06:31:37 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/?p=1862#comment-102714</guid>
		<description>Any suggestions for handling passwords containing backticks, braces, and other characters sacred to python?</description>
		<content:encoded><![CDATA[<p>Any suggestions for handling passwords containing backticks, braces, and other characters sacred to python?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rwoodrum</title>
		<link>http://scott.yang.id.au/2009/01/migrate-emails-maildir-gmail/#comment-102135</link>
		<dc:creator>rwoodrum</dc:creator>
		<pubDate>Sat, 20 Aug 2011 15:38:06 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/?p=1862#comment-102135</guid>
		<description>This worked like a charm for me though with a couple of easily fixed issues; dates preserved and all!  I&#039;m currently migrating from kmail due to an impending hard drive failure and figured this is a good time to finally move my crap to apps for domains :)

Confirmed as noted by chris above that it works fine for Apps for domains.  For anyone experiencing the upload-works-but-no-mail-shows-up this happened to me until I actually specified &quot;INBOX&quot; instead of the default &quot;All Mail&quot;.  Even when specifying &quot;All Mail&quot; via the default and looking at the label (which is hidden by default I believe in gmail) no messages were there after the upload.  I switched to &quot;INBOX&quot; and they showed right up.

To get anything to show up after a successful upload when specifying labels, commenting out the prepending of &quot;[Gmail]&quot; also works as noted above.

Finally, for nested labels, merely ensure they are created in gmail and specify them via -f/--folder as &quot;foo/bar&quot; for a &quot;top&quot; level label &quot;foo&quot; and a nested label &quot;bar&quot;.  Presumably this works for &quot;foo/bar/baz&quot; since labels can be nested to multiple levels.

Thanks for the code!</description>
		<content:encoded><![CDATA[<p>This worked like a charm for me though with a couple of easily fixed issues; dates preserved and all!  I&#8217;m currently migrating from kmail due to an impending hard drive failure and figured this is a good time to finally move my crap to apps for domains :)</p>
<p>Confirmed as noted by chris above that it works fine for Apps for domains.  For anyone experiencing the upload-works-but-no-mail-shows-up this happened to me until I actually specified &#8220;INBOX&#8221; instead of the default &#8220;All Mail&#8221;.  Even when specifying &#8220;All Mail&#8221; via the default and looking at the label (which is hidden by default I believe in gmail) no messages were there after the upload.  I switched to &#8220;INBOX&#8221; and they showed right up.</p>
<p>To get anything to show up after a successful upload when specifying labels, commenting out the prepending of &#8220;[Gmail]&#8221; also works as noted above.</p>
<p>Finally, for nested labels, merely ensure they are created in gmail and specify them via -f/&#8211;folder as &#8220;foo/bar&#8221; for a &#8220;top&#8221; level label &#8220;foo&#8221; and a nested label &#8220;bar&#8221;.  Presumably this works for &#8220;foo/bar/baz&#8221; since labels can be nested to multiple levels.</p>
<p>Thanks for the code!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arno</title>
		<link>http://scott.yang.id.au/2009/01/migrate-emails-maildir-gmail/#comment-102086</link>
		<dc:creator>Arno</dc:creator>
		<pubDate>Wed, 29 Jun 2011 13:03:46 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/?p=1862#comment-102086</guid>
		<description>Thanks, found your script very useful. Modified it a bit to copy emails to our imap server, regularly have to recover large amounts of email from maildir folders.</description>
		<content:encoded><![CDATA[<p>Thanks, found your script very useful. Modified it a bit to copy emails to our imap server, regularly have to recover large amounts of email from maildir folders.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cheong Tek Mun</title>
		<link>http://scott.yang.id.au/2009/01/migrate-emails-maildir-gmail/#comment-102031</link>
		<dc:creator>Cheong Tek Mun</dc:creator>
		<pubDate>Tue, 24 May 2011 07:26:13 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/?p=1862#comment-102031</guid>
		<description>I encountered the same problem as @Lockheed.  The script ran fine but nothing shown up in my Educational Google Apps email account.  Any suggestion?</description>
		<content:encoded><![CDATA[<p>I encountered the same problem as @Lockheed.  The script ran fine but nothing shown up in my Educational Google Apps email account.  Any suggestion?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: André</title>
		<link>http://scott.yang.id.au/2009/01/migrate-emails-maildir-gmail/#comment-101903</link>
		<dc:creator>André</dc:creator>
		<pubDate>Tue, 26 Apr 2011 17:10:37 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/?p=1862#comment-101903</guid>
		<description>Hi there -- thanks for the script. I have a bit of an awkward question and cannot think of the right keywords to search the &#039;net. I use a script based on this on a Cron job to funnel all my accounts to my Gmail account (for several reasons, this is the only way, unfortunately), but the receiving Gmail account does not mark the spam as spam. Any clues on how to work around this?</description>
		<content:encoded><![CDATA[<p>Hi there &#8212; thanks for the script. I have a bit of an awkward question and cannot think of the right keywords to search the &#8216;net. I use a script based on this on a Cron job to funnel all my accounts to my Gmail account (for several reasons, this is the only way, unfortunately), but the receiving Gmail account does not mark the spam as spam. Any clues on how to work around this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: scotty</title>
		<link>http://scott.yang.id.au/2009/01/migrate-emails-maildir-gmail/#comment-101449</link>
		<dc:creator>scotty</dc:creator>
		<pubDate>Mon, 03 Jan 2011 21:42:09 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/?p=1862#comment-101449</guid>
		<description>@Bilal -- according to Google you might not have correct password or checking too frequently?</description>
		<content:encoded><![CDATA[<p>@Bilal &#8212; according to Google you might not have correct password or checking too frequently?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bilal</title>
		<link>http://scott.yang.id.au/2009/01/migrate-emails-maildir-gmail/#comment-101340</link>
		<dc:creator>Bilal</dc:creator>
		<pubDate>Sat, 11 Dec 2010 22:43:26 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/?p=1862#comment-101340</guid>
		<description>Thank you very much. it is very good script, it is running fine with gmail account but i want to migrate maildir from postfix to Google Apps standard edition and it&#039;s not running succesfully .

 any help for this issue ?

Thanks.</description>
		<content:encoded><![CDATA[<p>Thank you very much. it is very good script, it is running fine with gmail account but i want to migrate maildir from postfix to Google Apps standard edition and it&#8217;s not running succesfully .</p>
<p> any help for this issue ?</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lockheed</title>
		<link>http://scott.yang.id.au/2009/01/migrate-emails-maildir-gmail/#comment-101331</link>
		<dc:creator>Lockheed</dc:creator>
		<pubDate>Fri, 10 Dec 2010 16:24:29 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/?p=1862#comment-101331</guid>
		<description>I seem to be running into an issue hear. The script runs fine and all messages are uploaded (around 10 messages) but they never show up in my gmail account. It is as empty as when I started and there is no new folders, too - I tried uploading to both existing and new folders.</description>
		<content:encoded><![CDATA[<p>I seem to be running into an issue hear. The script runs fine and all messages are uploaded (around 10 messages) but they never show up in my gmail account. It is as empty as when I started and there is no new folders, too &#8211; I tried uploading to both existing and new folders.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bilal</title>
		<link>http://scott.yang.id.au/2009/01/migrate-emails-maildir-gmail/#comment-101326</link>
		<dc:creator>Bilal</dc:creator>
		<pubDate>Thu, 09 Dec 2010 14:23:55 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/?p=1862#comment-101326</guid>
		<description>Thanks for this sript .
But i want to move maildir from postfix to standard Google Apps . when i run the script i get this error , Plz help.

&lt;pre&gt;
python maildir2gmail.py -u test@indemajtech.com -p Pass -f &quot;Drafts&quot; /home/Bilal/Maildir/.Drafts/cur
[16:20:08]: Sending &quot;25&quot; (2132746 bytes)
[16:20:09]: Unable to send /home/Bilal/Maildir/.Drafts/cur/1291895529.P4802Q0M897.localhost.localdomain:2,S
Traceback (most recent call last):
  File &quot;maildir2gmail.py&quot;, line 167, in ?
    main()
  File &quot;maildir2gmail.py&quot;, line 147, in main
    gmail.append(filename)
  File &quot;maildir2gmail.py&quot;, line 63, in append
    self.imap.append(self.folder, &#039;(\\Seen)&#039;, timestamp, content)
  File &quot;maildir2gmail.py&quot;, line 88, in imap
    self.__imap.login(self.username, self.password)
  File &quot;/usr/lib/python2.4/imaplib.py&quot;, line 482, in login
    raise self.error(dat[-1])
imaplib.error: [ALERT] Web login required: http://mail.google.com/support/bin/answer.py?answer=78754 (Failure)
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Thanks for this sript .<br />
But i want to move maildir from postfix to standard Google Apps . when i run the script i get this error , Plz help.</p>
<pre>
python maildir2gmail.py -u <a href="mailto:test@indemajtech.com">test@indemajtech.com</a> -p Pass -f "Drafts" /home/Bilal/Maildir/.Drafts/cur
[16:20:08]: Sending "25" (2132746 bytes)
[16:20:09]: Unable to send /home/Bilal/Maildir/.Drafts/cur/1291895529.P4802Q0M897.localhost.localdomain:2,S
Traceback (most recent call last):
  File "maildir2gmail.py", line 167, in ?
    main()
  File "maildir2gmail.py", line 147, in main
    gmail.append(filename)
  File "maildir2gmail.py", line 63, in append
    self.imap.append(self.folder, '(\\Seen)', timestamp, content)
  File "maildir2gmail.py", line 88, in imap
    self.__imap.login(self.username, self.password)
  File "/usr/lib/python2.4/imaplib.py", line 482, in login
    raise self.error(dat[-1])
imaplib.error: [ALERT] Web login required: <a href="http://mail.google.com/support/bin/answer.py?answer=78754" rel="nofollow">http://mail.google.com/support/bin/answer.py?answer=78754</a> (Failure)
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pablo</title>
		<link>http://scott.yang.id.au/2009/01/migrate-emails-maildir-gmail/#comment-100663</link>
		<dc:creator>Pablo</dc:creator>
		<pubDate>Sat, 02 Oct 2010 20:32:27 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/?p=1862#comment-100663</guid>
		<description>Thank you VERY much. Great script.</description>
		<content:encoded><![CDATA[<p>Thank you VERY much. Great script.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joost</title>
		<link>http://scott.yang.id.au/2009/01/migrate-emails-maildir-gmail/#comment-100560</link>
		<dc:creator>Joost</dc:creator>
		<pubDate>Sat, 28 Aug 2010 10:38:30 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/?p=1862#comment-100560</guid>
		<description>Works fine, valuable comments also on the folder/label usage. Saved my lots of time, thanks a lot for your effort and making this public!!</description>
		<content:encoded><![CDATA[<p>Works fine, valuable comments also on the folder/label usage. Saved my lots of time, thanks a lot for your effort and making this public!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chris</title>
		<link>http://scott.yang.id.au/2009/01/migrate-emails-maildir-gmail/#comment-100258</link>
		<dc:creator>chris</dc:creator>
		<pubDate>Tue, 06 Jul 2010 20:27:38 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/?p=1862#comment-100258</guid>
		<description>This works for migrating to GoogleApps as follows...

./maildir2gmail.py -u user@yourdomain.com -p yourpass /path/to/maildir/cur

where user@yourdomain.com differs from a gmail/googlemail user.

It really helps when you&#039;re a GoogleApps Standard user, and can&#039;t use the Email Migration API :)</description>
		<content:encoded><![CDATA[<p>This works for migrating to GoogleApps as follows&#8230;</p>
<p>./maildir2gmail.py -u <a href="mailto:user@yourdomain.com">user@yourdomain.com</a> -p yourpass /path/to/maildir/cur</p>
<p>where <a href="mailto:user@yourdomain.com">user@yourdomain.com</a> differs from a gmail/googlemail user.</p>
<p>It really helps when you&#8217;re a GoogleApps Standard user, and can&#8217;t use the Email Migration API :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

