From: Matthias A. <mat...@gm...> - 2005-09-21 10:47:04
|
Timothy Lee <tim...@si...> writes: > Current version of fetchmail fails to extract the recipient address if > "Delivered-To" is used as envelope header. This patch fixes the > problem. Can anyone please demonstrate or describe in detail the problem that is supposed to be fixed with this patch? Thanks in advance, > diff -Naur fetchmail-6.2.5/transact.c fetchmail-6.2.5.new/transact.c > --- fetchmail-6.2.5/transact.c 2003-10-11 04:55:05.000000000 +0800 > +++ fetchmail-6.2.5.new/transact.c 2005-03-02 16:41:50.000000000 +0800 > @@ -380,6 +380,7 @@ > char *received_for, *rcv, *cp; > static char *delivered_to = NULL; > int n, linelen, oldlen, ch, remaining, skipcount; > + int delivered_to_count; > struct idlist *idp; > flag no_local_matches = FALSE; > flag has_nuls; > @@ -416,6 +417,7 @@ > oldlen = 0; > msgblk.msglen = 0; > skipcount = 0; > + delivered_to_count = 0; > ctl->mimemsg = 0; > > for (remaining = fetchlen; remaining > 0 || protocol->delimited; ) > @@ -665,10 +667,15 @@ > */ > if (ctl->dropdelivered && !strncasecmp(line, "Delivered-To:", 13)) > { > - if (delivered_to) > + if (delivered_to || > + ctl->server.envelope == STRING_DISABLED || > + !ctl->server.envelope || > + strcasecmp(ctl->server.envelope, "Delivered-To") || > + delivered_to_count != ctl->server.envskip) > free(line); > else > delivered_to = line; > + delivered_to_count++; > continue; > } > -- Matthias Andree |