Re: [PATCH 10/20] cli/show: add tests for viewing protected headers

2018-06-24 Thread David Bremner
Daniel Kahn Gillmor  writes:

> +
> +# TODO:
> +#  * check S/MIME as well as PGP/MIME

Decrypting S/MIME would be good first step. Or is the feature there
(with gmime 3.0?) but tests missing? because T355-smime says there is no
S/MIME decryption.

> +#  * process headers protected by signature

> +
> +test_description='Message decryption with protected headers'
> +. $(dirname "$0")/test-lib.sh || exit 1
> +
> +##
> +
> +add_gnupg_home
> +# Change this if we ship a new test key
> +FINGERPRINT="5AEAB11F5E33DCE875DDB75B6D92612D94E46381"

I wonder if it would be reasonable for add_gnupg_home to define FINGERPRINT

> +
> +add_email_corpus protected-headers
> +
> +test_begin_subtest "verify protected header is not visible without 
> decryption"
> +output=$(notmuch show --format=json 
> id:protected-hea...@crypto.notmuchmail.org)
> +test_json_nodes <<<"$output" \
> +'no_crypto:[0][0][0]!"crypto"' \
> +'subject:[0][0][0]["headers"]["Subject"]="encrypted message"'

maybe a pointer to where to find the docs for the json test syntax.

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 09/20] util/crypto: add information about the payload part

2018-06-24 Thread David Bremner
Daniel Kahn Gillmor  writes:

> @@ -270,7 +274,7 @@ _notmuch_message_crypto_potential_payload 
> (_notmuch_message_crypto_t *msg_crypto
>  if (parent && GMIME_IS_MULTIPART_ENCRYPTED (parent) && childnum == 
> GMIME_MULTIPART_ENCRYPTED_VERSION) {
>   const char *enc_type = g_mime_object_get_content_type_parameter 
> (parent, "protocol");
>   GMimeContentType *ct = g_mime_object_get_content_type (payload);
> - if (ct) {
> + if (ct && enc_type) {
>   const char *part_type = g_mime_content_type_get_mime_type (ct);
>   if (part_type && strcmp (part_type, enc_type) == 0)
>   return NOTMUCH_STATUS_SUCCESS;

I couldn't really understand why enc_type was defined earlier than it
was used here. Is this a bug fix?

d
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] doc: clean up manpages

2018-06-24 Thread David Bremner
Daniel Kahn Gillmor  writes:

> Many of the manpages didn't treat literal text as literal text.  I've
> tried to normalize some of the restructured text to make it a bit more
> regular.
>

pushed.

d
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] doc: clean up manpages

2018-06-24 Thread Tomi Ollila
On Tue, Jun 19 2018, Daniel Kahn Gillmor wrote:

> Many of the manpages didn't treat literal text as literal text.  I've
> tried to normalize some of the restructured text to make it a bit more
> regular.
>
> several of the synopsis lines are still untouched by this cleanup, but
> i'm not sure what the right way to represent those is in .rst,
> actually.
>
> In particular find that if i rebuild the manpages, sometimes i end up
> with some of the synopsis lines showing – (U+2013 EN DASH) where they
> should have -- (2 × U+002D HYPHEN-MINUS) in the generated nroff
> output, though i have not tracked down the source of this error yet.

Looks OK to me.

Tomi
> ---
>  doc/man1/notmuch-address.rst  | 12 ++--
>  doc/man1/notmuch-dump.rst |  2 +-
>  doc/man1/notmuch-reply.rst|  2 +-
>  doc/man1/notmuch-search.rst   | 26 +-
>  doc/man1/notmuch-show.rst | 14 +++---
>  doc/man7/notmuch-search-terms.rst |  4 ++--
>  6 files changed, 30 insertions(+), 30 deletions(-)
>
> diff --git a/doc/man1/notmuch-address.rst b/doc/man1/notmuch-address.rst
> index c00d7d74..12d86e89 100644
> --- a/doc/man1/notmuch-address.rst
> +++ b/doc/man1/notmuch-address.rst
> @@ -32,8 +32,8 @@ Supported options for **address** include
>  ``--output=(sender|recipients|count|address)``
>  Controls which information appears in the output. This option can
>  be given multiple times to combine different outputs.  When
> -neither --output=sender nor --output=recipients is
> -given, --output=sender is implied.
> +neither ``--output=sender`` nor ``--output=recipients`` is
> +given, ``--output=sender`` is implied.
>  
>  **sender**
>  Output all addresses from the *From* header.
> @@ -63,19 +63,19 @@ Supported options for **address** include
>  
>  **no**
>  Output all occurrences of addresses in the matching
> -messages. This is not applicable with --output=count.
> +messages. This is not applicable with ``--output=count``.
>  
>  **mailbox**
>  Deduplicate addresses based on the full, case sensitive name
>  and email address, or mailbox. This is effectively the same as
> -piping the --deduplicate=no output to **sort | uniq**, except
> +piping the ``--deduplicate=no`` output to **sort | uniq**, except
>  for the order of results. This is the default.
>  
>  **address**
>  Deduplicate addresses based on the case insensitive address
>  part of the mailbox. Of all the variants (with different name
>  or case), print the one occurring most frequently among the
> -matching messages. If --output=count is specified, include all
> +matching messages. If ``--output=count`` is specified, include all
>  variants in the count.
>  
>  ``--sort=``\ (**newest-first**\ \|\ **oldest-first**)
> @@ -86,7 +86,7 @@ Supported options for **address** include
>  By default, results will be displayed in reverse chronological
>  order, (that is, the newest results will be displayed first).
>  
> -However, if either --output=count or --deduplicate=address is
> +However, if either ``--output=count`` or ``--deduplicate=address`` is
>  specified, this option is ignored and the order of the results is
>  unspecified.
>  
> diff --git a/doc/man1/notmuch-dump.rst b/doc/man1/notmuch-dump.rst
> index f8ec4868..ec6335b2 100644
> --- a/doc/man1/notmuch-dump.rst
> +++ b/doc/man1/notmuch-dump.rst
> @@ -21,7 +21,7 @@ incremental backup than the native database files.)
>  
>  See **notmuch-search-terms(7)** for details of the supported syntax
>  for . With no search terms, a dump of all messages in
> -the database will be generated. A "--" argument instructs notmuch that
> +the database will be generated. A ``--`` argument instructs notmuch that
>  the remaining arguments are search terms.
>  
>  Supported options for **dump** include
> diff --git a/doc/man1/notmuch-reply.rst b/doc/man1/notmuch-reply.rst
> index c893ba04..5c64c4a6 100644
> --- a/doc/man1/notmuch-reply.rst
> +++ b/doc/man1/notmuch-reply.rst
> @@ -75,7 +75,7 @@ Supported options for **reply** include
>  If ``true``, decrypt any MIME encrypted parts found in the
>  selected content (i.e., "multipart/encrypted" parts). Status
>  of the decryption will be reported (currently only supported
> -with --format=json and --format=sexp), and on successful
> +with ``--format=json`` and ``--format=sexp``), and on successful
>  decryption the multipart/encrypted part will be replaced by
>  the decrypted content.
>  
> diff --git a/doc/man1/notmuch-search.rst b/doc/man1/notmuch-search.rst
> index e42da2ae..654c5f2c 100644
> --- a/doc/man1/notmuch-search.rst
> +++ b/doc/man1/notmuch-search.rst
> @@ -47,25 +47,25 @@ Supported options for **search** include
>  
>  **threads**
>  Output the thread IDs of all threads with any message matching
> -

Re: GitHub + notmuch scripts/hacks

2018-06-24 Thread William Casarin
William Casarin  writes:

> I've started collecting[1] a bunch of notmuch+GitHub hacks from some of
> the discussions @ id:87d16jtsdj@kyleam.com
> [..]
>
> [1] https://github.com/jb55/notmuch-github
> [2] 
> https://github.com/jb55/notmuch-github/commit/fb2d80cf9ee9a5967c78ae6ccda866ee98cdd547
> [3] https://jb55.com/s/notmuch-github.mp4

Hey notmuch peoples,

I've started looking into possible ways to tag github pull requests and
issues. So far I've been able to put together these semi-reliable
tagging methods for pull requests:

notmuch tag +github from:github.com and tag:inbox

notmuch tag +pr '"You can view, comment on, or merge this pull request 
online at"' \
  and tag:github and not tag:pr and tag:inbox and not tag:issue

# tag all messages in the thread that have a pr tag
notmuch tag +pr $(notmuch search --output=threads tag:pr and tag:inbox)

# this seems to be a semi reliable way to find github merge emails
notmuch tag +merged Merged and event from:notificati...@github.com \
  and not tag:merged and tag:inbox and tag:pr

# tag the entire pr thread as merged
notmuch tag +merged $(notmuch search --output=threads tag:merged and 
tag:inbox)

I still haven't found a reliable way to tag issues and their closed
status. If anyone has something more reliable feel free to share here or
at https://github.com/jb55/notmuch-github#tagging

Cheers,
Will


--
https://jb55.com
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch