Warning when GMime is parsing broken email addresses

Matthieu Lemerre racin at free.fr
Wed Nov 17 14:20:26 PST 2010


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 at 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 at 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


More information about the notmuch mailing list