--- /dev/null
+Return-Path: <Jason@zx2c4.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 97276431FB6\r
+ for <notmuch@notmuchmail.org>; Fri, 7 Dec 2012 05:49:49 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.099\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.099 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id O2WfDsP14z4f for <notmuch@notmuchmail.org>;\r
+ Fri, 7 Dec 2012 05:49:49 -0800 (PST)\r
+X-Greylist: delayed 48332 seconds by postgrey-1.32 at olra;\r
+ Fri, 07 Dec 2012 05:49:48 PST\r
+Received: from homiemail-a61.g.dreamhost.com (caiajhbdccah.dreamhost.com\r
+ [208.97.132.207])\r
+ by olra.theworths.org (Postfix) with ESMTP id C6B5D431FAE\r
+ for <notmuch@notmuchmail.org>; Fri, 7 Dec 2012 05:49:48 -0800 (PST)\r
+Received: from homiemail-a61.g.dreamhost.com (localhost [127.0.0.1])\r
+ by homiemail-a61.g.dreamhost.com (Postfix) with ESMTP id 08914578073\r
+ for <notmuch@notmuchmail.org>; Fri, 7 Dec 2012 05:49:47 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=mime-version\r
+ :in-reply-to:references:date:message-id:subject:from:to:cc:\r
+ content-type; s=zx2c4.com; bh=VSX4X9fqHCIXgkcbkWPR2fAMn/A=; b=Gv\r
+ JO81FYMPGIiW8q+mQV8X33NvnMqHtQsYn74mc6pD7a0s/U7ymN6u/cZEwCWeLtYn\r
+ d5c6pgW5+KeSW3PODn/7HxacqC8X9B8/jQwg3QK1p/mjAo3kZ/1qwDsXTdTOSLcj\r
+ 2L5YdlKFBoKm6BftgNWArs6dcqemGSbn57SkAb99o=\r
+Received: from mail-ob0-f181.google.com (mail-ob0-f181.google.com\r
+ [209.85.214.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ (Authenticated sender: jason@zx2c4.com)\r
+ by homiemail-a61.g.dreamhost.com (Postfix) with ESMTPSA id D30BE57806E\r
+ for <notmuch@notmuchmail.org>; Fri, 7 Dec 2012 05:49:46 -0800 (PST)\r
+Received: by mail-ob0-f181.google.com with SMTP id oi10so416438obb.26\r
+ for <notmuch@notmuchmail.org>; Fri, 07 Dec 2012 05:49:46 -0800 (PST)\r
+MIME-Version: 1.0\r
+Received: by 10.182.130.99 with SMTP id od3mr3176568obb.61.1354888186324; Fri,\r
+ 07 Dec 2012 05:49:46 -0800 (PST)\r
+Received: by 10.76.33.70 with HTTP; Fri, 7 Dec 2012 05:49:46 -0800 (PST)\r
+In-Reply-To: <20121207092305.4942.42415@megatron>\r
+References:\r
+ <CAHmME9om0twqigr0L2pwXtbj4ceBVVFz0HqxkwFfB-AnusP2VQ@mail.gmail.com>\r
+ <50c16b03.47e2440a.6038.ffffedce@mx.google.com> <50C1AEA0.9090508@gmail.com>\r
+ <20121207092305.4942.42415@megatron>\r
+Date: Fri, 7 Dec 2012 14:49:46 +0100\r
+Message-ID:\r
+ <CAHmME9q6QN1YE=+_r1zHNdhc9hrJgEWxQ_L4rxsjJWOFRD-ZnA@mail.gmail.com>\r
+Subject: Re: gmail importer script\r
+From: "Jason A. Donenfeld" <Jason@zx2c4.com>\r
+To: Patrick Totzke <patricktotzke@gmail.com>\r
+Content-Type: multipart/alternative; boundary=14dae93b61340e663e04d0437d93\r
+Cc: public-notmuch-gxuj+Tv9EO5zyzON3hdc1g@plane.gmane.org,\r
+ notmuch@notmuchmail.org, Rainer M Krug <R.M.Krug@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 07 Dec 2012 13:49:49 -0000\r
+\r
+--14dae93b61340e663e04d0437d93\r
+Content-Type: text/plain; charset=ISO-8859-1\r
+\r
+On Fri, Dec 7, 2012 at 10:23 AM, Patrick Totzke <patricktotzke@gmail.com>wrote:\r
+\r
+> Is this supposed to happen?\r
+>\r
+\r
+Obviously not.\r
+\r
+\r
+\r
+>\r
+> ---------------------------------------------\r
+> Logging in...\r
+> Selecting all mail...\r
+> Discovering local messages...\r
+> Receiving message list...\r
+> Traceback (most recent call last):\r
+> File "./gmail-notmuch.py", line 175, in <module>\r
+> main()\r
+> File "./gmail-notmuch.py", line 58, in main\r
+> new_messages = discover_new_messages(imap, old_messages)\r
+> File "./gmail-notmuch.py", line 80, in discover_new_messages\r
+> typ, data = imap.fetch("1:*", "X-GM-MSGID")\r
+> File "/usr/lib/python2.7/imaplib.py", line 443, in fetch\r
+> typ, dat = self._simple_command(name, message_set, message_parts)\r
+> File "/usr/lib/python2.7/imaplib.py", line 1070, in _simple_command\r
+> return self._command_complete(name, self._command(name, *args))\r
+> File "/usr/lib/python2.7/imaplib.py", line 825, in _command\r
+> ', '.join(Commands[name])))\r
+> imaplib.error: command FETCH illegal in state AUTH, only allowed in states\r
+> SELECTED\r
+>\r
+>\r
+Not sure what is causing this. My best guess is that your password was\r
+incorrect and that I'm not checking the login return value.\r
+\r
+\r
+\r
+> ------------------------------------------------------\r
+>\r
+>\r
+> In [2]: imaplib.__version__\r
+> Out[2]: '2.58'\r
+>\r
+> One thing you also might want to watch out for is\r
+> exceptions due to a locked notmuch index.\r
+>\r
+\r
+How do I do this?\r
+\r
+\r
+\r
+> rock on,\r
+> /p\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r
+>\r
+\r
+--14dae93b61340e663e04d0437d93\r
+Content-Type: text/html; charset=ISO-8859-1\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+<br><br><div class=3D"gmail_quote">On Fri, Dec 7, 2012 at 10:23 AM, Patrick=\r
+ Totzke <span dir=3D"ltr"><<a href=3D"mailto:patricktotzke@gmail.com" ta=\r
+rget=3D"_blank">patricktotzke@gmail.com</a>></span> wrote:<br><blockquot=\r
+e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol=\r
+id;padding-left:1ex">\r
+Is this supposed to happen?<br></blockquote><div><br></div><div>Obviously n=\r
+ot.</div><div><br></div><div>=A0</div><blockquote class=3D"gmail_quote" sty=\r
+le=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">\r
+<br>\r
+---------------------------------------------<br>\r
+Logging in...<br>\r
+Selecting all mail...<br>\r
+Discovering local messages...<br>\r
+Receiving message list...<br>\r
+Traceback (most recent call last):<br>\r
+=A0 File "./gmail-notmuch.py", line 175, in <module><br>\r
+=A0 =A0 main()<br>\r
+=A0 File "./gmail-notmuch.py", line 58, in main<br>\r
+=A0 =A0 new_messages =3D discover_new_messages(imap, old_messages)<br>\r
+=A0 File "./gmail-notmuch.py", line 80, in discover_new_messages<=\r
+br>\r
+=A0 =A0 typ, data =3D imap.fetch("1:*", "X-GM-MSGID")<b=\r
+r>\r
+=A0 File "/usr/lib/python2.7/imaplib.py", line 443, in fetch<br>\r
+=A0 =A0 typ, dat =3D self._simple_command(name, message_set, message_parts)=\r
+<br>\r
+=A0 File "/usr/lib/python2.7/imaplib.py", line 1070, in _simple_c=\r
+ommand<br>\r
+=A0 =A0 return self._command_complete(name, self._command(name, *args))<br>\r
+=A0 File "/usr/lib/python2.7/imaplib.py", line 825, in _command<b=\r
+r>\r
+=A0 =A0 ', '.join(Commands[name])))<br>\r
+imaplib.error: command FETCH illegal in state AUTH, only allowed in states =\r
+SELECTED<br>\r
+<br></blockquote><div><br></div><div>Not sure what is causing this. My best=\r
+ guess is that your password was incorrect and that I'm not checking th=\r
+e login return value.</div><div><br></div><div>=A0</div><blockquote class=\r
+=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=\r
+ing-left:1ex">\r
+\r
+------------------------------------------------------<br>\r
+<br>\r
+<br>\r
+In [2]: imaplib.__version__<br>\r
+Out[2]: '2.58'<br>\r
+<br>\r
+One thing you also might want to watch out for is<br>\r
+exceptions due to a locked notmuch index.<br></blockquote><div><br></div><d=\r
+iv>How do I do this?</div><div><br></div><div>=A0</div><blockquote class=3D=\r
+"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding=\r
+-left:1ex">\r
+\r
+rock on,<br>\r
+/p<br>\r
+<div class=3D"HOEnZb"><div class=3D"h5">___________________________________=\r
+____________<br>\r
+notmuch mailing list<br>\r
+<a href=3D"mailto:notmuch@notmuchmail.org">notmuch@notmuchmail.org</a><br>\r
+<a href=3D"http://notmuchmail.org/mailman/listinfo/notmuch" target=3D"_blan=\r
+k">http://notmuchmail.org/mailman/listinfo/notmuch</a></div></div></blockqu=\r
+ote></div>\r
+\r
+--14dae93b61340e663e04d0437d93--\r