]> diplodocus.org Git - nmh/commitdiff
Replace profile-based hack to allow getname() to handle 8-bit
authorDavid Levine <levinedl@acm.org>
Sat, 24 Sep 2016 21:08:01 +0000 (17:08 -0400)
committerDavid Levine <levinedl@acm.org>
Sat, 24 Sep 2016 21:08:01 +0000 (17:08 -0400)
addresses with a global data-based hack.  At least the global
data is hidden in addrsbr.c.

h/addrsbr.h
sbr/addrsbr.c
uip/post.c

index de5dc3b..1b147f6 100644 (file)
@@ -40,6 +40,12 @@ struct mailname {
 void mnfree(struct mailname *);
 int ismymbox(struct mailname *);
 
+/*
+ * Enable Email Address Internationalization, which requires
+ * support of 8-bit addresses.
+ */
+void enable_eai();
+
 /*
  * Parse an address header, and return a sequence of email addresses.
  * This function is the main entry point into the nmh address parser.
index f8b98f2..6bb9421 100644 (file)
@@ -76,17 +76,22 @@ static char *grp = NULL;
 static char *note = NULL;
 static char err[BUFSIZ];
 static char adr[BUFSIZ];
+static int eai = 0;
+
+void
+enable_eai() {
+    eai = 1;
+}
 
 
 char *
 getname (const char *addrs)
 {
     struct adrx *ap;
-    const char *const eai = context_find ("eai");
     pers = mbox = host = route = grp = note = NULL;
     err[0] = '\0';
 
-    if ((ap = getadrx (addrs ? addrs : "", eai && strncasecmp (eai, "utf-8", 5) == 0)) == NULL) {
+    if ((ap = getadrx (addrs ? addrs : "", eai)) == NULL) {
        return NULL;
     }
 
index 810d678..47941af 100644 (file)
@@ -791,9 +791,8 @@ putfmt (char *name, char *str, int *eai, FILE *out)
             /* Enable SMTPUTF8. */
             *eai = 1;
 
-            /* Add eai profile entry, to pass utf-8 setting to
-               getname()/getadrx(). */
-            add_profile_entry ("eai", "utf-8");
+            /* Enable passing of utf-8 setting to getname()/getadrx(). */
+            enable_eai();
         }
     }