Re: [PATCH] test: add regression test for Subject with newline.

Subject: Re: [PATCH] test: add regression test for Subject with newline.

Date: Mon, 10 Oct 2022 18:24:26 -0300

To: Thibault Polge,

Cc: Daniel Kahn Gillmor, Jakub Wilk

From: David Bremner

David Bremner <> writes:

> This tests the issue reported by Thibault in
> ---
> 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


import pathlib
import tempfile

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

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


with tempfile.NamedTemporaryFile() as tmpfile:
    fp =, '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}'

notmuch mailing list --
To unsubscribe send an email to