fetchmail-friends
[Top] [All Lists]

Re: [fetchmail]scratch list in uid.c

2001-03-22 02:03:48
Frantisek Brabec <frb_97(_at_)yahoo(_dot_)com>:
About the uid.c file and the scratchlist data
structure:

Each account with UIDL engaged that is listed in
.fetchmailrc retrieves IDs of already seen messages
from .fetchids.  IDs that belong to accounts that are
currently not in .fetchmailrc are stored in a
scratchlist (static struct idlist *scratchlist;
).  The idea I guess is to preserve IDs of messages
even for users who are not in the fetchmailrc
currently but may be added again later.

Not quite.  It's actually to avoid nuking UIDL information from
un-queried hosts when we do an explicit subset query with hosts given
on the command line.
 
Unfortunately, it doesn't really work that way as the
scratchlist gets wiped out whenever there is a
successful update of IDs for the users currently in
fetchmailrc (function uid_swap_lists).  You probably
really want to preserve whatever is in scratchlist
until the user involved gets entered into .fetchmailrc
again.  To achieve this, I propose to get rid of the
line

free_str_list(&scratchlist);

in uid.c file.  The downside of course is that if the
user is never put back in .fetchmailrc again, some
entries may hang around .fetchids forever.

I've done this for 5.7.6, adding an explanatory comment.
-- 
                <a href="http://www.tuxedo.org/~esr/";>Eric S. Raymond</a>

Probably fewer than 2% of handguns and well under 1% of all guns will
ever be involved in a violent crime. Thus, the problem of criminal gun
violence is concentrated within a very small subset of gun owners,
indicating that gun control aimed at the general population faces a
serious needle-in-the-haystack problem.
        -- Gary Kleck, "Point Blank: Handgun Violence In America"