aboutsummaryrefslogtreecommitdiffstats
path: root/driver.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-10-13 21:11:33 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-10-13 21:11:33 +0000
commit5480ab320b813bddefe7383582c45b88bec00013 (patch)
treebdef3e4ea6f663efc97a68830cefe85683039fae /driver.c
parentc868890caebd7a1408665c7799864b08be0a4021 (diff)
downloadfetchmail-5480ab320b813bddefe7383582c45b88bec00013.tar.gz
fetchmail-5480ab320b813bddefe7383582c45b88bec00013.tar.bz2
fetchmail-5480ab320b813bddefe7383582c45b88bec00013.zip
Added envelope-skip feature.
svn path=/trunk/; revision=1509
Diffstat (limited to 'driver.c')
-rw-r--r--driver.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/driver.c b/driver.c
index 756ab2b1..01014f96 100644
--- a/driver.c
+++ b/driver.c
@@ -543,7 +543,7 @@ int num; /* index of message */
char buf[MSGBUFSIZE+1], return_path[MSGBUFSIZE+1];
int from_offs, ctt_offs, env_offs, next_address;
char *headers, *received_for, *desthost, *rcv;
- int n, linelen, oldlen, ch, remaining;
+ int n, linelen, oldlen, ch, remaining, skipcount;
char *cp;
struct idlist *idp, *xmit_names;
flag good_addresses, bad_addresses, has_nuls;
@@ -562,6 +562,7 @@ int num; /* index of message */
from_offs = ctt_offs = env_offs = -1;
oldlen = 0;
msglen = 0;
+ skipcount = 0;
for (remaining = fetchlen; remaining > 0 || protocol->delimited; remaining -= linelen)
{
@@ -778,11 +779,17 @@ int num; /* index of message */
if (env_offs == -1 && !strncasecmp(ctl->server.envelope,
line,
strlen(ctl->server.envelope)))
+ if (skipcount++ != ctl->server.envskip)
+ continue;
env_offs = (line - headers);
}
#ifdef HAVE_RES_SEARCH
else if (!received_for && !strncasecmp("Received:", line, 9))
+ {
+ if (skipcount++ != ctl->server.envskip)
+ continue;
received_for = parse_received(ctl, line);
+ }
#endif /* HAVE_RES_SEARCH */
}
}