unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Thibault Polge <thibault@thb.lt>, notmuch@notmuchmail.org
Cc: Daniel Kahn Gillmor <dkg@debian.org>, Jakub Wilk <jwilk@jwilk.net>
Subject: Re: [PATCH] test: add regression test for Subject with newline.
Date: Mon, 10 Oct 2022 18:24:26 -0300	[thread overview]
Message-ID: <87czaztlrp.fsf@tethera.net> (raw)
In-Reply-To: <20220923234824.676622-1-david@tethera.net>

David Bremner <david@tethera.net> writes:

> This tests the issue reported by Thibault in id:87wn9w4xus.fsf@thb.lt
> ---
>
> I could not duplicate the problem here. Maybe it depends on the version of gmime?
> I have 3.2.9 here.

Now that I have gmime 3.2.13 I can confirm your bug (my previously
posted test fails).  It seems the purely a gmime issue (the following
reproducer is thanks to Jakub Wilk; on debian it needs the package
gir1.2-gmime-3.0).

#!/usr/bin/python3

import pathlib
import tempfile

import gi
gi.require_version('GMime', '3.0')
from gi.repository import GMime
GMime.init()

msg = b'''\
Subject: =?UTF-8?B?SGVsbG8=?= =?UTF-8?B?IHdvcmxk?=

.
'''

with tempfile.NamedTemporaryFile() as tmpfile:
    tmpfile.write(msg)
    tmpfile.flush()
    fp = GMime.StreamFile.open(tmpfile.name, 'r')
    parser = GMime.Parser.new_with_stream(fp)
    msg = parser.construct_message()
    subject = msg.subject
    expected = 'Hello world'
    assert subject == expected, f'{subject!r} != {expected!r}'


  reply	other threads:[~2022-10-10 21:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-21 14:15 Possible bug: incorrect processing of multipart, base64-encoded subject lines Thibault Polge
2022-09-23 23:48 ` [PATCH] test: add regression test for Subject with newline David Bremner
2022-10-10 21:24   ` David Bremner [this message]
2022-12-27 15:50     ` David Bremner
2022-10-14 14:49 ` Possible bug: incorrect processing of multipart, base64-encoded subject lines Jakub Wilk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87czaztlrp.fsf@tethera.net \
    --to=david@tethera.net \
    --cc=dkg@debian.org \
    --cc=jwilk@jwilk.net \
    --cc=notmuch@notmuchmail.org \
    --cc=thibault@thb.lt \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).