From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 7CC286DE035A for ; Fri, 2 Jun 2017 02:51:26 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.173 X-Spam-Level: X-Spam-Status: No, score=-0.173 tagged_above=-999 required=5 tests=[AWL=-0.425, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_SOFTFAIL=0.972] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MlhU5GgMMS-W for ; Fri, 2 Jun 2017 02:51:25 -0700 (PDT) X-Greylist: delayed 1247 seconds by postgrey-1.36 at arlo; Fri, 02 Jun 2017 02:51:25 PDT Received: from 18.mo6.mail-out.ovh.net (18.mo6.mail-out.ovh.net [46.105.73.110]) by arlo.cworth.org (Postfix) with ESMTPS id 3B8956DE0355 for ; Fri, 2 Jun 2017 02:51:25 -0700 (PDT) Received: from player787.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo6.mail-out.ovh.net (Postfix) with ESMTP id 2D580E03EE for ; Fri, 2 Jun 2017 10:35:11 +0200 (CEST) Received: from localhost (LStLambert-657-1-97-93.w90-63.abo.wanadoo.fr [90.63.216.93]) (Authenticated sender: contact@javascript-ninja.fr) by player787.ha.ovh.net (Postfix) with ESMTPSA id C7BA560007F; Fri, 2 Jun 2017 10:35:09 +0200 (CEST) Date: Fri, 2 Jun 2017 10:35:03 +0200 From: Edgar Hipp To: David Edmondson Cc: notmuch@notmuchmail.org Subject: Re: Show email adress in output of `notmuch search --format json` Message-ID: <20170602083503.vjakloikbse24prv@fr-fadpc15.europe.altair.com> References: <20170601065917.tb7enmxklevslevt@fr-fadpc15.europe.altair.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: User-Agent: NeoMutt/20170306 (1.8.0) X-Ovh-Tracer-Id: 2539748715768792738 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeljedrhedugddtjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecu X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 09:51:26 -0000 On Thu, Jun 01, 2017 at 10:41:02AM +0100, David Edmondson wrote: > On Thursday, 2017-06-01 at 08:59:17 +0200, Edgar Hipp wrote: >=20 > > Hello ! > > > > I'm building a tool that combines fzf (a fuzzy finder) and notmuch to > > find email more interactively. > > > > For that, it would be great if the --format=3Djson would return not just > > the author name, but also the author email. > > > > I run :=20 > > > > ``` > > notmuch search --format=3Djson '*' | tail -1 > > ``` > > > > And get following output :=20 > > > > ``` > > {"thread": "0000000000000b72", "timestamp": 1397639242, "date_relative"= : "2014-04-16", "matched": 1, "total": 1, "authors": "-a l'attention de con= tact-", "subject": "[SPAM] Lettre d'information", "query": ["id:SKT8635X-JC= WL-FS8M-IDH7-WTK8XFCLCQ@idealcoursier.com", null], "tags": ["inbox"]}] > > ``` > > > > I would like to get the real email adress too :=20 > > > > ``` > > {"thread": "0000000000000b72", "timestamp": 1397639242, "date_relative"= : "2014-04-16", "matched": 1, "total": 1, "authoremail": "contact@idealcour= sier.com", "authors": "-a l'attention de contact-", "subject": "[SPAM] Lett= re d'information", "query": ["id:SKT8635X-JCWL-FS8M-IDH7-WTK8XFCLCQ@idealco= ursier.com", null], "tags": ["inbox"]}] > > ``` > > > > More generally, it would be great to have a configuration option to > > specify which fields you want, like how `git log --format=3D` works. > > > > What do you think ? >=20 > You're using the output of =E2=80=9Csearch=E2=80=9D: >=20 > % notmuch search --format=3Djson id:20170601065917.tb7enmxklevslevt@fr-fa= dpc15.europe.altair.com > [{"thread": "0000000000037667", "timestamp": 1496300357, "date_relative":= "Today 07:59", "matched": 1, "total": 1, "authors": "Edgar Hipp", "subject= ": "Show email adress in output of `notmuch search --format json`", "query"= : ["id:20170601065917.tb7enmxklevslevt@fr-fadpc15.europe.altair.com", null]= , "tags": ["inbox4", "list", "notmuch"]}] >=20 > Perhaps the output of =E2=80=9Cshow=E2=80=9D is more what you're after? >=20 > % notmuch show --format=3Djson id:20170601065917.tb7enmxklevslevt@fr-fadp= c15.europe.altair.com > [[[{"id": "20170601065917.tb7enmxklevslevt@fr-fadpc15.europe.altair.com",= "match": true, "excluded": false, "filename": "/home/dme/Maildir/.d.list.n= otmuch/cur/1496309415_0.21047.disaster-area,U=3D12312,FMD5=3D48696af6d61a01= 2532c1ce55c0592d76:2,S", "timestamp": 1496300357, "date_relative": "Today 0= 7:59", "tags": ["inbox4", "list", "notmuch"], "headers": {"Subject": "Show = email adress in output of `notmuch search --format json`", "From": "Edgar H= ipp ", "To": "notmuch@notmuchmail.org", "Date"= : "Thu, 01 Jun 2017 08:59:17 +0200"}, "body": [{"id": 1, "content-type": "t= ext/plain", "content": "Hello !\n\nI'm building a tool that combines fzf (a= fuzzy finder) and notmuch to\nfind email more interactively.\n\nFor that, = it would be great if the --format=3Djson would return not just\nthe author = name, but also the author email.\n\nI run : \n\n```\nnotmuch search --form= at=3Djson '*' | tail -1\n```\n\nAnd get following output : \n\n```\n{\"thre= ad\": \"0000000000000b72\", \"timestamp\": 1397639242, \"date_relative\": \= "2014-04-16\", \"matched\": 1, \"total\": 1, \"authors\": \"-a l'attention = de contact-\", \"subject\": \"[SPAM] Lettre d'information\", \"query\": [\"= id:SKT8635X-JCWL-FS8M-IDH7-WTK8XFCLCQ@idealcoursier.com\", null], \"tags\":= [\"inbox\"]}]\n```\n\nI would like to get the real email adress too : \n\n= ```\n{\"thread\": \"0000000000000b72\", \"timestamp\": 1397639242, \"date_r= elative\": \"2014-04-16\", \"matched\": 1, \"total\": 1, \"authoremail\": \= "contact@idealcoursier.com\", \"authors\": \"-a l'attention de contact-\", = \"subject\": \"[SPAM] Lettre d'information\", \"query\": [\"id:SKT8635X-JCW= L-FS8M-IDH7-WTK8XFCLCQ@idealcoursier.com\", null], \"tags\": [\"inbox\"]}]\= n```\n\nMore generally, it would be great to have a configuration option to= \nspecify which fields you want, like how `git log --format=3D` works.\n\nW= hat do you think ?\n\nBest,\n\nEdgar\n\n___________________________________= ____________\nnotmuch mailing list\nnotmuch@notmuchmail.org\nhttps://notmuc= hmail.org/mailman/listinfo/notmuch\n"}]}, []]]] > %=20 >=20 > The =E2=80=9Csearch=E2=80=9D output is meant purely for displaying a list= of threads, so > the information presented is limited to whatever was considered > necessary for that. >=20 > dme. > --=20 > And the sign said long haired freaky people need not apply. Sorry, I wasn't completely clear. What I'm doing is basically=20 notmuch search --format=3Djson '*' | processing_program | fzf Which makes it possible to search trough messages interactively : fzf is a fuzzy finder(see the gif on the page https://github.com/junegunn/fzf) What I would expect is to have the same format as show but for multiple messages, (in my case for search). That's why I would find it interesting to be able to customize the fields shown in search. Best, Edgar