--- /dev/null
+2003-10-16 Jeremy Katz <katzj@redhat.com>
+
+ * e-host-utils.c (e_gethostbyname_r): use AI_ADDRCONFIG if
+ available to avoid returning IPv6 addresses to hosts without an
+ IPv6 interface.
+
+Index: e-util//e-host-utils.c
+===================================================================
+RCS file: /cvs/gnome/evolution/e-util/e-host-utils.c,v
+retrieving revision 1.14.4.2
+diff -u -u -r1.14.4.2 e-host-utils.c
+--- e-util//e-host-utils.c 8 Oct 2003 20:36:22 -0000 1.14.4.2
++++ e-util//e-host-utils.c 17 Oct 2003 19:38:08 -0000
+@@ -187,10 +187,21 @@
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = 0;
+ hints.ai_protocol = 0;
+-
++
++#ifdef AI_ADDRCONFIG
++ hints.ai_flags |= AI_ADDRCONFIG;
++#endif
++
+ if ((retval = getaddrinfo (name, NULL, &hints, &res)) != 0) {
+- *herr = ai_to_herr (retval);
+- return -1;
++#ifdef AI_ADDRCONFIG
++ hints.ai_flags &= ~AI_ADDRCONFIG;
++ if ((retval != EAI_BADFLAGS) || (retval = getaddrinfo (name, NULL, &hints, &res)) != 0) {
++#endif
++ *herr = ai_to_herr (retval);
++ return -1;
++#ifdef AI_ADDRCONFIG
++ }
++#endif
+ }
+
+ len = ALIGN (strlen (res->ai_canonname) + 1);