unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Incorrect parsing of email addresses (MIME with quotes)
@ 2011-10-24 11:53 Petter Reinholdtsen
  2011-10-24 16:09 ` Daniel Kahn Gillmor
  0 siblings, 1 reply; 6+ messages in thread
From: Petter Reinholdtsen @ 2011-10-24 11:53 UTC (permalink / raw)
  To: notmuch


The notmuch email frontend have a problem parsing email headers.
The problem is headers like this

  From: "=?iso-8859-1?q?=D8yvind_Normann?=" <oyvind.norman@uio.no>

which my mailbox got a lot of.  The frontend show the address as 

  =?iso-8859-1?q?=D8yvind_Normann?=

instead of

  Øyvind Normann

The problem is the quotes around the MIME encoded string.  Mutt and
Gnus handle these headers properly, but notmuch do not.

Any hope of having this fixed in a future version of ntomuch?

-- 
Happy hacking,
Petter Reinholdtsen

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

* Re: Incorrect parsing of email addresses (MIME with quotes)
  2011-10-24 11:53 Incorrect parsing of email addresses (MIME with quotes) Petter Reinholdtsen
@ 2011-10-24 16:09 ` Daniel Kahn Gillmor
  2011-11-21 12:38   ` Petter Reinholdtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Kahn Gillmor @ 2011-10-24 16:09 UTC (permalink / raw)
  To: Petter Reinholdtsen; +Cc: notmuch

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

On 10/24/2011 07:53 AM, Petter Reinholdtsen wrote:
> 
> The notmuch email frontend have a problem parsing email headers.
> The problem is headers like this
> 
>   From: "=?iso-8859-1?q?=D8yvind_Normann?=" <oyvind.norman@uio.no>
> 
> which my mailbox got a lot of.  The frontend show the address as 
> 
>   =?iso-8859-1?q?=D8yvind_Normann?=
> 
> instead of
> 
>   Øyvind Normann
> 
> The problem is the quotes around the MIME encoded string.  Mutt and
> Gnus handle these headers properly, but notmuch do not.


http://tools.ietf.org/html/rfc2047#page-8

states quite clearly:

   + An 'encoded-word' MUST NOT appear within a 'quoted-string'.

I'd argue that notmuch is doing the right thing here, and that MUAs that
wrap encoded words in quotes (or that apply decoding rules within quoted
strings) are the ones that need fixing.

Regards,

	--dkg


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 1030 bytes --]

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

* Re: Incorrect parsing of email addresses (MIME with quotes)
  2011-10-24 16:09 ` Daniel Kahn Gillmor
@ 2011-11-21 12:38   ` Petter Reinholdtsen
  2011-11-22 23:30     ` David Bremner
  0 siblings, 1 reply; 6+ messages in thread
From: Petter Reinholdtsen @ 2011-11-21 12:38 UTC (permalink / raw)
  To: notmuch


[Daniel Kahn Gillmor]
> http://tools.ietf.org/html/rfc2047#page-8
> 
> states quite clearly:
> 
>    + An 'encoded-word' MUST NOT appear within a 'quoted-string'.
> 
> I'd argue that notmuch is doing the right thing here, and that MUAs that
> wrap encoded words in quotes (or that apply decoding rules within quoted
> strings) are the ones that need fixing.

Well, feel free to spend time on trying to get the other mail programs
changed.  I do not have the privilege to give that project a priority
myself.

I just hope the notmuch developers can choose to follow the robustness
principle[1] in this case, and be liberal in what notmuch accept, and
conservative in what notmuch send.  After all, gnus, mutt and pine
handle these from fields.

 1 http://en.wikipedia.org/wiki/Robustness_principle
-- 
Happy hacking,
Petter Reinholdtsen

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

* Re: Incorrect parsing of email addresses (MIME with quotes)
  2011-11-21 12:38   ` Petter Reinholdtsen
@ 2011-11-22 23:30     ` David Bremner
  2011-11-23  2:58       ` Austin Clements
  2011-11-25  5:49       ` Petter Reinholdtsen
  0 siblings, 2 replies; 6+ messages in thread
From: David Bremner @ 2011-11-22 23:30 UTC (permalink / raw)
  To: Petter Reinholdtsen, notmuch

On Mon, 21 Nov 2011 13:38:57 +0100, Petter Reinholdtsen <pere@hungry.com> wrote:

> I just hope the notmuch developers can choose to follow the robustness
> principle[1] in this case, and be liberal in what notmuch accept, and
> conservative in what notmuch send.  After all, gnus, mutt and pine
> handle these from fields.

It's a nice stick to beat people with, but I'm not sure it's directly
applicable here. Notmuch is accepting the input, it just isn't
displaying it the way you want. I guess if somebody has some patches for
"sloppy header parsing", we can weigh the pros and cons then.

If someone wants to follow up on this, we are currently using

http://spruce.sourceforge.net/gmime/doc/gmime-gmime-utils.html#g-mime-utils-header-decode-text

There is some discussion there about dealing with bad inputs; I don't
know if it is directly relevant.

d

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

* Re: Incorrect parsing of email addresses (MIME with quotes)
  2011-11-22 23:30     ` David Bremner
@ 2011-11-23  2:58       ` Austin Clements
  2011-11-25  5:49       ` Petter Reinholdtsen
  1 sibling, 0 replies; 6+ messages in thread
From: Austin Clements @ 2011-11-23  2:58 UTC (permalink / raw)
  To: David Bremner; +Cc: notmuch, Petter Reinholdtsen

Quoth David Bremner on Nov 22 at  7:30 pm:
> On Mon, 21 Nov 2011 13:38:57 +0100, Petter Reinholdtsen <pere@hungry.com> wrote:
> > I just hope the notmuch developers can choose to follow the robustness
> > principle[1] in this case, and be liberal in what notmuch accept, and
> > conservative in what notmuch send.  After all, gnus, mutt and pine
> > handle these from fields.
> 
> It's a nice stick to beat people with, but I'm not sure it's directly
> applicable here. Notmuch is accepting the input, it just isn't
> displaying it the way you want. I guess if somebody has some patches for
> "sloppy header parsing", we can weigh the pros and cons then.
> 
> If someone wants to follow up on this, we are currently using
> 
> http://spruce.sourceforge.net/gmime/doc/gmime-gmime-utils.html#g-mime-utils-header-decode-text
> 
> There is some discussion there about dealing with bad inputs; I don't
> know if it is directly relevant.

Based on
  http://comments.gmane.org/gmane.mail.mime.gmime.devel/65
I thought gmime was supposed to be dealing with broken RFC 2047
encoding now.  Am I misinterpreting it?  Maybe a bug needs to be filed
against gmime?

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

* Re: Incorrect parsing of email addresses (MIME with quotes)
  2011-11-22 23:30     ` David Bremner
  2011-11-23  2:58       ` Austin Clements
@ 2011-11-25  5:49       ` Petter Reinholdtsen
  1 sibling, 0 replies; 6+ messages in thread
From: Petter Reinholdtsen @ 2011-11-25  5:49 UTC (permalink / raw)
  To: notmuch


[David Bremner]
> Notmuch is accepting the input, it just isn't displaying it the way
> you want.

Well, I guess that is mostly a question of semantics and definitions.
To me it isn't really accepting the input when I try to reply to an
email with the problem in question and end up with

  On Mon, 20 Jun 2011 11:12:00 +0200, "=?iso-8859-1?q?=D8yvind_Normann?=" <oyvind.normann@example.com> wrote:

One thing is not seeing the name properly in my client, but
broadcasting to my contacts my tools inability to process the From:
field is not something I can stand for.  So I really hope this can be
solved.  I hope Austin is right that this bug is fixed in later
versions of gmime.  I will try to upgrade and see if it solve the
issue.
-- 
Happy hacking
Petter Reinholdtsen

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

end of thread, other threads:[~2011-11-25  5:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-24 11:53 Incorrect parsing of email addresses (MIME with quotes) Petter Reinholdtsen
2011-10-24 16:09 ` Daniel Kahn Gillmor
2011-11-21 12:38   ` Petter Reinholdtsen
2011-11-22 23:30     ` David Bremner
2011-11-23  2:58       ` Austin Clements
2011-11-25  5:49       ` Petter Reinholdtsen

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