--- /dev/null
+Return-Path: <tomi.ollila@iki.fi>\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 3F88F431FC0\r
+ for <notmuch@notmuchmail.org>; Tue, 21 May 2013 07:15:11 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ 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 bIwPNoNox1pe for <notmuch@notmuchmail.org>;\r
+ Tue, 21 May 2013 07:15:07 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id A2A92431FB6\r
+ for <notmuch@notmuchmail.org>; Tue, 21 May 2013 07:15:06 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id 325D41002C3;\r
+ Tue, 21 May 2013 17:15:04 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: david@tethera.net, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] devel: add dkg's printmimestructure script to notmuch\r
+ devel scripts\r
+In-Reply-To: <1369065559-30788-1-git-send-email-david@tethera.net>\r
+References: <1369065559-30788-1-git-send-email-david@tethera.net>\r
+User-Agent: Notmuch/0.15.2+99~g7e455bc (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+ $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+ !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Tue, 21 May 2013 17:15:03 +0300\r
+Message-ID: <m2y5b84dy0.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\r
+Cc: David Bremner <bremner@debian.org>\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: Tue, 21 May 2013 14:15:11 -0000\r
+\r
+On Mon, May 20 2013, david@tethera.net wrote:\r
+\r
+> From: David Bremner <bremner@debian.org>\r
+>\r
+> I find this script pretty useful when figuring out who to blame for\r
+> MIME rendering problems. It currently isn't very widely known, so it\r
+> seems worth distributing with notmuch.\r
+> ---\r
+\r
+Good idea! +1\r
+\r
+Tomi\r
+\r
+>\r
+> I did a small amount whitespace cleanup compared to version in dkg's git =\r
+repo.\r
+>\r
+> devel/printmimestructure | 54 ++++++++++++++++++++++++++++++++++++++++++=\r
+++++++\r
+> 1 file changed, 54 insertions(+)\r
+> create mode 100755 devel/printmimestructure\r
+>\r
+> diff --git a/devel/printmimestructure b/devel/printmimestructure\r
+> new file mode 100755\r
+> index 0000000..b8084a9\r
+> --- /dev/null\r
+> +++ b/devel/printmimestructure\r
+> @@ -0,0 +1,54 @@\r
+> +#!/usr/bin/env python\r
+> +# -*- coding: utf-8 -*-\r
+> +\r
+> +# Author: Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
+> +# License: GPLv3+\r
+> +\r
+> +# Updates: git://lair.fifthhorseman.net/~dkg/printmimestructure\r
+> +\r
+> +# This script reads a MIME message from stdin and produces a treelike\r
+> +# representation on it stdout.\r
+> +\r
+> +# Example:\r
+> +#\r
+> +# 0 dkg@alice:~$ printmimestructure < 'Maildir/cur/1269025522.M338697P12=\r
+023.monkey,S=3D6459,W=3D6963:2,Sa'\r
+> +# =E2=94=94=E2=94=AC=E2=95=B4multipart/signed 6546 bytes\r
+> +# =E2=94=9C=E2=94=80=E2=95=B4text/plain inline 895 bytes\r
+> +# =E2=94=94=E2=94=80=E2=95=B4application/pgp-signature inline [signatur=\r
+e.asc] 836 bytes\r
+> +# 0 dkg@alice:~$\r
+> +\r
+> +\r
+> +# If you want to number the parts, i suggest piping the output through\r
+> +# something like "cat -n"\r
+> +\r
+> +import email\r
+> +import sys\r
+> +\r
+> +def test(z, prefix=3D''):\r
+> + fname =3D '' if z.get_filename() is None else ' [' + z.get_filename(=\r
+) + ']'\r
+> + cset =3D '' if z.get_charset() is None else ' (' + z.get_charset() +=\r
+ ')'\r
+> + disp =3D z.get_params(None, header=3D'Content-Disposition')\r
+> + if (disp is None):\r
+> + disposition =3D ''\r
+> + else:\r
+> + disposition =3D ''\r
+> + for d in disp:\r
+> + if d[0] in [ 'attachment', 'inline' ]:\r
+> + disposition =3D ' ' + d[0]\r
+> + if (z.is_multipart()):\r
+> + print prefix + '=E2=94=AC=E2=95=B4' + z.get_content_type() + cse=\r
+t + disposition + fname, z.as_string().__len__().__str__() + ' bytes'\r
+> + if prefix.endswith('=E2=94=94'):\r
+> + prefix =3D prefix.rpartition('=E2=94=94')[0] + ' '\r
+> + if prefix.endswith('=E2=94=9C'):\r
+> + prefix =3D prefix.rpartition('=E2=94=9C')[0] + '=E2=94=82'\r
+> + parts =3D z.get_payload()\r
+> + i =3D 0\r
+> + while (i < parts.__len__()-1):\r
+> + test(parts[i], prefix + '=E2=94=9C')\r
+> + i +=3D 1\r
+> + test(parts[i], prefix + '=E2=94=94')\r
+> + # FIXME: show epilogue?\r
+> + else:\r
+> + print prefix + '=E2=94=80=E2=95=B4'+ z.get_content_type() + cset=\r
+ + disposition + fname, z.get_payload().__len__().__str__(), 'bytes'\r
+> +\r
+> +test(email.message_from_file(sys.stdin), '=E2=94=94')\r
+> --=20\r
+> 1.8.2.rc2\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r