diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1996-11-20 00:34:41 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1996-11-20 00:34:41 +0000 |
commit | 39ced7e9afccbff096a1a3ec737cc8246164194a (patch) | |
tree | f81751b6cae3854a287068f3c7f523e8a31cd239 | |
parent | 7b3c3bbd3b9f9383ccb559cf39631cf411fae0fc (diff) | |
download | fetchmail-39ced7e9afccbff096a1a3ec737cc8246164194a.tar.gz fetchmail-39ced7e9afccbff096a1a3ec737cc8246164194a.tar.bz2 fetchmail-39ced7e9afccbff096a1a3ec737cc8246164194a.zip |
Better envelope address deduction.
svn path=/trunk/; revision=561
-rw-r--r-- | driver.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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", |