unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Warning when GMime is parsing broken email addresses
@ 2010-11-17 22:20 Matthieu Lemerre
  2010-11-18 18:37 ` Matthieu Lemerre
  2011-04-25 22:23 ` Carl Worth
  0 siblings, 2 replies; 9+ messages in thread
From: Matthieu Lemerre @ 2010-11-17 22:20 UTC (permalink / raw)
  To: notmuch


Hi,

I just realized that GMime is not robust to some broken email addresses
sent by broken email clients. I received a mail, with the to field being

xxxx.yyyy <uuuu-vvvv@gmail.com>

The email client (Exchange) had forgotten to put a "" around
"xxxx.yyyy", which is necessary because `.' is a special character, and
this confused GMime. This resulted in notmuch storing xxxx.yyyy as the
email address, instead of using uuuu-vvvv@gmail.com. Because of that I
had trouble finding one of my mail using a to: in the search terms.

I have filed a bug report for GMime
(https://bugzilla.gnome.org/show_bug.cgi?id=545333), but I just wanted
to make people using notmuch aware of this problem, because I guess that
such problems might be extremely common.

Maybe it would also be interesting to add a warning/assertion to check
that all email adresses added to the database are correct email
addresses? I.e. check that the `addr' variable in _index_address_mailbox
always has a @. This check is in fact already done using the function
strchr, but a bad value is explicitly ignored...

Matthieu

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

* Re: Warning when GMime is parsing broken email addresses
  2010-11-17 22:20 Warning when GMime is parsing broken email addresses Matthieu Lemerre
@ 2010-11-18 18:37 ` Matthieu Lemerre
  2010-11-18 18:51   ` Daniel Kahn Gillmor
  2011-04-25 22:23 ` Carl Worth
  1 sibling, 1 reply; 9+ messages in thread
From: Matthieu Lemerre @ 2010-11-18 18:37 UTC (permalink / raw)
  To: notmuch


The problem is solved in version 2.4.18 (current is
2.4.20). Unfortunately the last version packaged for Debian is 2.4.14...

Matthieu

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

* Re: Warning when GMime is parsing broken email addresses
  2010-11-18 18:37 ` Matthieu Lemerre
@ 2010-11-18 18:51   ` Daniel Kahn Gillmor
  2010-11-20 11:23     ` Matthieu Lemerre
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Kahn Gillmor @ 2010-11-18 18:51 UTC (permalink / raw)
  To: notmuch

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

Re: Warning when GMime is parsing broken email addresses:

On 11/18/2010 01:37 PM, Matthieu Lemerre wrote:
> The problem is solved in version 2.4.18 (current is
> 2.4.20). Unfortunately the last version packaged for Debian is 2.4.14...

is the patch that fixes the problem it backportable to 2.4.14 ?  I'm
sure a report to the debian bts with a patch would be appreciated.  even
if it doesn't make it into the release because of the freeze, a
narrowly-targeted patch might be acceptable for a future point release.

	--dkg (IANARM)


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

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

* Re: Warning when GMime is parsing broken email addresses
  2010-11-18 18:51   ` Daniel Kahn Gillmor
@ 2010-11-20 11:23     ` Matthieu Lemerre
  2010-11-20 14:35       ` Daniel Kahn Gillmor
  0 siblings, 1 reply; 9+ messages in thread
From: Matthieu Lemerre @ 2010-11-20 11:23 UTC (permalink / raw)
  To: Daniel Kahn Gillmor, notmuch

On Thu, 18 Nov 2010 13:51:59 -0500, Daniel Kahn Gillmor <dkg@fifthhorseman.net> wrote:
> Re: Warning when GMime is parsing broken email addresses:
> 
> On 11/18/2010 01:37 PM, Matthieu Lemerre wrote:
> > The problem is solved in version 2.4.18 (current is
> > 2.4.20). Unfortunately the last version packaged for Debian is 2.4.14...
> 
> is the patch that fixes the problem it backportable to 2.4.14 ?  I'm
> sure a report to the debian bts with a patch would be appreciated.  even
> if it doesn't make it into the release because of the freeze, a
> narrowly-targeted patch might be acceptable for a future point release.

Don't know. The main problem is that the package seems to have been more
or less abandoned by its maintainer though... 

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

* Re: Warning when GMime is parsing broken email addresses
  2010-11-20 11:23     ` Matthieu Lemerre
@ 2010-11-20 14:35       ` Daniel Kahn Gillmor
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel Kahn Gillmor @ 2010-11-20 14:35 UTC (permalink / raw)
  To: Matthieu Lemerre; +Cc: notmuch

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

On 11/20/2010 06:23 AM, Matthieu Lemerre wrote:
> On Thu, 18 Nov 2010 13:51:59 -0500, Daniel Kahn Gillmor <dkg@fifthhorseman.net> wrote:
>> Re: Warning when GMime is parsing broken email addresses:
>>
>> On 11/18/2010 01:37 PM, Matthieu Lemerre wrote:
>>> The problem is solved in version 2.4.18 (current is
>>> 2.4.20). Unfortunately the last version packaged for Debian is 2.4.14...
>>
>> is the patch that fixes the problem it backportable to 2.4.14 ?  I'm
>> sure a report to the debian bts with a patch would be appreciated.  even
>> if it doesn't make it into the release because of the freeze, a
>> narrowly-targeted patch might be acceptable for a future point release.
> 
> Don't know. The main problem is that the package seems to have been more
> or less abandoned by its maintainer though... 

That's certainly not the case for upstream, where i recently had
basically the ideal interaction:

  https://bugzilla.gnome.org/show_bug.cgi?id=635152

If you're saying the debian package has been abandoned, that's even more
of a reason to file a debian bug -- i don't see any listed outstanding
issues that might indicate abandonment on either the library package or
its source:

 http://bugs.debian.org/cgi-bin/pkgreport.cgi?package=libgmime-2.4-2
 http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=gmime2.4

Filing a bug would help to start documenting abandonment, if that is
indeed the case.  Once it's documented, we can try to do something about it.

Regards,

	--dkg


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

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

* Re: Warning when GMime is parsing broken email addresses
  2010-11-17 22:20 Warning when GMime is parsing broken email addresses Matthieu Lemerre
  2010-11-18 18:37 ` Matthieu Lemerre
@ 2011-04-25 22:23 ` Carl Worth
  2011-04-27 16:30   ` Xavier Maillard
  1 sibling, 1 reply; 9+ messages in thread
From: Carl Worth @ 2011-04-25 22:23 UTC (permalink / raw)
  To: Matthieu Lemerre, notmuch

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

On Wed, 17 Nov 2010 23:20:26 +0100, Matthieu Lemerre <racin@free.fr> wrote:
> Maybe it would also be interesting to add a warning/assertion to check
> that all email adresses added to the database are correct email
> addresses? I.e. check that the `addr' variable in _index_address_mailbox
> always has a @. This check is in fact already done using the function
> strchr, but a bad value is explicitly ignored...

Hmm... we could add a warning like that. But I don't know how useful it
would actually be. (I, for one, am currently not seeing any warnings
From "notmuch new"---maybe I should fix that...).

Since GMime is fixed upstream (as of version 2.4.18) another option
would be to simply make the notmuch build system require a sufficiently
new version of GMime in order to build.

What do you think?

-Carl

-- 
carl.d.worth@intel.com

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: Warning when GMime is parsing broken email addresses
  2011-04-25 22:23 ` Carl Worth
@ 2011-04-27 16:30   ` Xavier Maillard
  2011-04-27 19:59     ` Pieter Praet
  0 siblings, 1 reply; 9+ messages in thread
From: Xavier Maillard @ 2011-04-27 16:30 UTC (permalink / raw)
  To: Carl Worth, Matthieu Lemerre, notmuch

On Mon, 25 Apr 2011 15:23:41 -0700, Carl Worth <cworth@cworth.org> wrote:
> On Wed, 17 Nov 2010 23:20:26 +0100, Matthieu Lemerre <racin@free.fr> wrote:
> > Maybe it would also be interesting to add a warning/assertion to check
> > that all email adresses added to the database are correct email
> > addresses? I.e. check that the `addr' variable in _index_address_mailbox
> > always has a @. This check is in fact already done using the function
> > strchr, but a bad value is explicitly ignored...
> 
> Hmm... we could add a warning like that. But I don't know how useful it
> would actually be. (I, for one, am currently not seeing any warnings
> From "notmuch new"---maybe I should fix that...).
> 
> Since GMime is fixed upstream (as of version 2.4.18) another option
> would be to simply make the notmuch build system require a sufficiently
> new version of GMime in order to build.
> 
> What do you think?

My vote goes to the latter. Cleaner and really simple solution.

/Xavier

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

* Re: Warning when GMime is parsing broken email addresses
  2011-04-27 16:30   ` Xavier Maillard
@ 2011-04-27 19:59     ` Pieter Praet
  2011-05-13 22:33       ` Matthieu Lemerre
  0 siblings, 1 reply; 9+ messages in thread
From: Pieter Praet @ 2011-04-27 19:59 UTC (permalink / raw)
  To: Xavier Maillard, Carl Worth, Matthieu Lemerre, notmuch

On Wed, 27 Apr 2011 18:30:09 +0200, Xavier Maillard <xavier@maillard.im> wrote:
> On Mon, 25 Apr 2011 15:23:41 -0700, Carl Worth <cworth@cworth.org> wrote:
> > On Wed, 17 Nov 2010 23:20:26 +0100, Matthieu Lemerre <racin@free.fr> wrote:
> > > Maybe it would also be interesting to add a warning/assertion to check
> > > that all email adresses added to the database are correct email
> > > addresses? I.e. check that the `addr' variable in _index_address_mailbox
> > > always has a @. This check is in fact already done using the function
> > > strchr, but a bad value is explicitly ignored...
> > 
> > Hmm... we could add a warning like that. But I don't know how useful it
> > would actually be. (I, for one, am currently not seeing any warnings
> > From "notmuch new"---maybe I should fix that...).
> > 
> > Since GMime is fixed upstream (as of version 2.4.18) another option
> > would be to simply make the notmuch build system require a sufficiently
> > new version of GMime in order to build.
> > 
> > What do you think?
> 
> My vote goes to the latter. Cleaner and really simple solution.
> 
> /Xavier
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

I'd say both.

Unfortunately, regressions are not uncommon, and regardless, it'd be
nice to be notified when what we stuff in the db is not sane.

It would however be a good idea IMHO to check email address more
thorougly [1] than simply verifying whether an "@" is present.


Peace

-Pieter


[1] http://www.regular-expressions.info/email.html

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

* Re: Warning when GMime is parsing broken email addresses
  2011-04-27 19:59     ` Pieter Praet
@ 2011-05-13 22:33       ` Matthieu Lemerre
  0 siblings, 0 replies; 9+ messages in thread
From: Matthieu Lemerre @ 2011-05-13 22:33 UTC (permalink / raw)
  To: Pieter Praet, Xavier Maillard, Carl Worth, notmuch

On Wed, 27 Apr 2011 21:59:09 +0200, Pieter Praet <pieter@praet.org> wrote:
> On Wed, 27 Apr 2011 18:30:09 +0200, Xavier Maillard <xavier@maillard.im> wrote:
> > On Mon, 25 Apr 2011 15:23:41 -0700, Carl Worth <cworth@cworth.org> wrote:
> > > On Wed, 17 Nov 2010 23:20:26 +0100, Matthieu Lemerre <racin@free.fr> wrote:
> > > > Maybe it would also be interesting to add a warning/assertion to check
> > > > that all email adresses added to the database are correct email
> > > > addresses? I.e. check that the `addr' variable in _index_address_mailbox
> > > > always has a @. This check is in fact already done using the function
> > > > strchr, but a bad value is explicitly ignored...
> > > 
> > > Since GMime is fixed upstream (as of version 2.4.18) another option
> > > would be to simply make the notmuch build system require a sufficiently
> > > new version of GMime in order to build.
> > > 
> > > What do you think?
> 
> I'd say both.
> 
> Unfortunately, regressions are not uncommon, and regardless, it'd be
> nice to be notified when what we stuff in the db is not sane.
> 
> It would however be a good idea IMHO to check email address more
> thorougly [1] than simply verifying whether an "@" is present.

I agree with that, unless it is undesirable to add a dependency to a
regex library to notmuch? If so, the @ check could still be done (and is
_already_ present).

I don't see the warnings either, but maybe with proper differentiation
between stdout and stderr, I could arrange to print stderr and see the
warning messages in emacs when I explicitely launch my mail
synchronization script.

Matthieu

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

end of thread, other threads:[~2011-05-13 22:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-17 22:20 Warning when GMime is parsing broken email addresses Matthieu Lemerre
2010-11-18 18:37 ` Matthieu Lemerre
2010-11-18 18:51   ` Daniel Kahn Gillmor
2010-11-20 11:23     ` Matthieu Lemerre
2010-11-20 14:35       ` Daniel Kahn Gillmor
2011-04-25 22:23 ` Carl Worth
2011-04-27 16:30   ` Xavier Maillard
2011-04-27 19:59     ` Pieter Praet
2011-05-13 22:33       ` Matthieu Lemerre

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