Fix bug #3109 “libravatar: make mail address lower case before hashing MD5”
authorChristian Hesse <mail@eworm.de>
Thu, 13 Mar 2014 14:03:39 +0000 (15:03 +0100)
committerRicardo Mones <ricardo@mones.org>
Fri, 14 Mar 2014 07:53:54 +0000 (08:53 +0100)
Thanks again Christian Hesse for the patch!

src/plugins/libravatar/libravatar.c

index 843ffb4..ef9219e 100644 (file)
@@ -58,8 +58,15 @@ static gboolean libravatar_header_update_hook(gpointer source, gpointer data)
        debug_print("libravatar avatar_header_update invoked\n");
 
        if (!strcmp(acd->header, "From:")) {
-               gchar *a = g_strdup(acd->content);
+               gchar *a, *lower;
+
+               a = g_strdup(acd->content);
                extract_address(a);
+
+               /* string to lower */
+               for (lower = a; *lower; lower++)
+                       *lower = g_ascii_tolower(*lower);
+
                debug_print("libravatar added '%s'\n", a);
                procmsg_msginfo_add_avatar(acd->msginfo, AVATAR_LIBRAVATAR, a);
        }