aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-11-20 00:34:41 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-11-20 00:34:41 +0000
commit39ced7e9afccbff096a1a3ec737cc8246164194a (patch)
treef81751b6cae3854a287068f3c7f523e8a31cd239
parent7b3c3bbd3b9f9383ccb559cf39631cf411fae0fc (diff)
downloadfetchmail-39ced7e9afccbff096a1a3ec737cc8246164194a.tar.gz
fetchmail-39ced7e9afccbff096a1a3ec737cc8246164194a.tar.bz2
fetchmail-39ced7e9afccbff096a1a3ec737cc8246164194a.zip
Better envelope address deduction.
svn path=/trunk/; revision=561
-rw-r--r--driver.c11
1 files 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",