]> diplodocus.org Git - nmh/blobdiff - sbr/mf.c
Hard-code the config/version.c target, instead of using $@, so its
[nmh] / sbr / mf.c
index 84f1afa94dfcc77a8ce9b9f4803b3ed469cfbe90..c88681787e5a72297eeb3880123b5e3eded978b4 100644 (file)
--- a/sbr/mf.c
+++ b/sbr/mf.c
@@ -8,8 +8,6 @@
  */
 
 #include <h/mf.h>
-#include <ctype.h>
-#include <stdio.h>
 #include <h/utils.h>
 
 /*
@@ -23,6 +21,7 @@ static int local_part (char *);
 static int domain (char *);
 static int route (char *);
 static int my_lex (char *);
+static int contains8bit (const char *);
 
 
 int
@@ -232,6 +231,15 @@ getadrx (const char *addrs)
            break;
        }
 
+    /*
+     * Reject the address if key fields contain 8bit characters
+     */
+
+    if (contains8bit(mbox) || contains8bit(host) || contains8bit(path) ||
+       contains8bit(grp)) {
+       strcpy(err, "Address contains 8-bit characters");
+    }
+
     if (err[0])
        for (;;) {
            switch (last_lex) {
@@ -720,6 +728,25 @@ got_atom: ;
 }
 
 
+/*
+ * Return true if the string contains an 8-bit character
+ */
+
+static int
+contains8bit(const char *p)
+{
+    if (! p)
+       return 0;
+
+    for (; *p; p++) {
+       if (! isascii((unsigned char) *p))
+           return 1;
+    }
+
+    return 0;
+}
+
+
 char *
 legal_person (const char *p)
 {