* getadrx() implements a partial 822-style address parser. The parser
* is neither complete nor correct. It does however recognize nearly all
* of the 822 address syntax. In addition it handles the majority of the
- * 733 syntax as well. Most problems arise from trying to accomodate both.
+ * 733 syntax as well. Most problems arise from trying to accommodate both.
*
* In terms of 822, the route-specification in
*
static struct adrx adrxs2;
+/* eai = Email Address Internationalization */
struct adrx *
-getadrx (const char *addrs)
+getadrx (const char *addrs, int eai)
{
- register char *bp;
- register struct adrx *adrxp = &adrxs2;
+ char *bp;
+ struct adrx *adrxp = &adrxs2;
if (pers)
free (pers);
break;
}
+ if (! eai) {
+ /*
+ * Reject the address if key fields contain 8bit characters
+ */
+
+ if (contains8bit(mbox, NULL) || contains8bit(host, NULL) ||
+ contains8bit(path, NULL) || contains8bit(grp, NULL)) {
+ strcpy(err, "Address contains 8-bit characters");
+ }
+ }
+
if (err[0])
for (;;) {
switch (last_lex) {
static int
route_addr (char *buffer)
{
- register char *pp = cp;
+ char *pp = cp;
if (my_lex (buffer) == LX_AT) {
if (route (buffer) == NOTOK)
legal_person (const char *p)
{
int i;
- register const char *cp;
+ const char *cp;
static char buffer[BUFSIZ];
if (*p == '"')
mfgets (FILE *in, char **bp)
{
int i;
- register char *cp, *dp, *ep;
+ char *cp, *dp, *ep;
static int len = 0;
static char *pp = NULL;