unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Bug#1021614: notmuch: RFC2047-encoded special characters in display-name show up unquoted
@ 2022-10-11 20:02 Jakub Wilk
  2022-10-11 20:28 ` Jakub Wilk
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Wilk @ 2022-10-11 20:02 UTC (permalink / raw)
  To: submit

[-- Attachment #1: Type: text/plain, Size: 962 bytes --]

Package: notmuch
Version: 0.37-1

The attached message has a bunch of RFC-2047-encoded special characters 
in the display-name part of the From field:

    $ grep ^From: weird-from.eml
    From: =?UTF-8?Q?=3Cfoo=40example.org=3E=2C?= <bar@example.org>

When you show this message in notmuch, the special characters show up 
unquoted (and unencoded), so that it looks like there are two addresses 
in the From field:

    $ ./notmuch-show-from < weird-from.eml
    From: <foo@example.org>, <bar@example.org>

I initially thought this is a GMime bug, but it seems GMime gets this 
right:

    $ ./gmime-show-from < weird-from.eml
    From: "<foo@example.org>," <bar@example.org>


-- System Information:
Architecture: i386

Versions of packages notmuch depends on:
ii  libnotmuch5     0.37-1
ii  libc6           2.35-3
ii  libglib2.0-0    2.74.0-2
ii  libgmime-3.0-0  3.2.13+dfsg-2
ii  libtalloc2      2.3.4-1
ii  zlib1g          1:1.2.11.dfsg-4.1

-- 
Jakub Wilk

[-- Attachment #2: weird-from.eml --]
[-- Type: message/rfc822, Size: 64 bytes --]

From: "<foo@example.org>," <bar@example.org>



[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Bug#1021614: notmuch: RFC2047-encoded special characters in display-name show up unquoted
  2022-10-11 20:02 Bug#1021614: notmuch: RFC2047-encoded special characters in display-name show up unquoted Jakub Wilk
@ 2022-10-11 20:28 ` Jakub Wilk
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Wilk @ 2022-10-11 20:28 UTC (permalink / raw)
  To: 1021614

[-- Attachment #1: Type: text/plain, Size: 88 bytes --]

Attaching the reprocucer scripts, which somehow got lost in transport!?

-- 
Jakub Wilk

[-- Attachment #2: notmuch-show-from --]
[-- Type: text/plain, Size: 255 bytes --]

#!/bin/bash
set -e -u
tmpdir="$(mktemp -d)"
export NOTMUCH_DATABASE="$tmpdir"
notmuch --config '' new > /dev/null
mkdir -p "$NOTMUCH_DATABASE"/{cur,new,tmp}
notmuch --config '' insert > /dev/null
notmuch --config '' show '*' | grep ^From:
rm -rf "tmpdir"

[-- Attachment #3: gmime-show-from --]
[-- Type: text/plain, Size: 365 bytes --]

#!/usr/bin/python3

import sys

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

stream = GMime.StreamPipe.new(sys.stdin.fileno())
parser = GMime.Parser.new_with_stream(stream)
msg = parser.construct_message()
addrs = msg.get_from()
addrs = addrs.to_string(GMime.FormatOptions(), True)
print('From:', addrs)

[-- Attachment #4: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-14 11:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-11 20:02 Bug#1021614: notmuch: RFC2047-encoded special characters in display-name show up unquoted Jakub Wilk
2022-10-11 20:28 ` Jakub Wilk

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).