From 39ced7e9afccbff096a1a3ec737cc8246164194a Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 20 Nov 1996 00:34:41 +0000 Subject: Better envelope address deduction. svn path=/trunk/; revision=561 --- driver.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/driver.c b/driver.c index 8b7ea869..71e91928 100644 --- a/driver.c +++ b/driver.c @@ -368,22 +368,25 @@ struct query *ctl; /* query control record */ strcpy(rbuf, "by "); strcat(rbuf, ctl->canonical_name); if ((ok = strstr(bufp, rbuf))) - ok = strstr(bufp, "for "); + ok = strstr(ok, "for <"); + else + ok = (char *)NULL; if (ok) { char *sp, *tp; tp = rbuf; - for (sp = ok + 4; *sp && *sp != ';'; sp++) + for (sp = ok + 5; *sp && *sp != '>' && *sp != '@'; sp++) *tp++ = *sp; *tp = '\0'; - if (*sp != ';') + if (*sp != ';' && *sp != '@') ok = (char *)NULL; } if (ok) { - received_for = rbuf; + received_for = alloca(strlen(rbuf)+1); + strcpy(received_for, rbuf); if (outlevel == O_VERBOSE) fprintf(stderr, "fetchmail: found Received address `%s'\n", -- cgit v1.2.3