$OpenBSD: patch-rfc2047_c,v 1.1 2010/10/02 01:22:12 sthen Exp $

RFC2047 encode/decode the group name in an address list.
upstream f2452f1f1fef, fixes bug#3317

--- rfc2047.c.orig	Sat Oct  2 01:57:10 2010
+++ rfc2047.c	Sat Oct  2 01:58:41 2010
@@ -614,6 +614,8 @@ void rfc2047_encode_adrlist (ADDRESS *addr, const char
   {
     if (ptr->personal)
       _rfc2047_encode_string (&ptr->personal, 1, col);
+    else if (ptr->group && ptr->mailbox)
+      _rfc2047_encode_string (&ptr->mailbox, 1, col);
 #ifdef EXACT_ADDRESS
     if (ptr->val)
       _rfc2047_encode_string (&ptr->val, 1, col);
@@ -910,6 +912,8 @@ void rfc2047_decode_adrlist (ADDRESS *a)
     if (a->personal && ((strstr (a->personal, "=?") != NULL) || 
 			(AssumedCharset && *AssumedCharset)))
       rfc2047_decode (&a->personal);
+    else if (a->group && a->mailbox && (strstr (a->mailbox, "=?") != NULL))
+      rfc2047_decode (&a->mailbox);
 #ifdef EXACT_ADDRESS
     if (a->val && strstr (a->val, "=?") != NULL)
       rfc2047_decode (&a->val);
