fetchmail-friends
[Top] [All Lists]

Re: [fetchmail]UIDL of processed messages not stored in case of error

2001-05-12 09:31:42
Eric - adding the single line as I suggested in the
option a) below is all it takes. So those few lines in
the area would now look as follows:

 if ((sdp->val.status.num == num)
               && (!toolarge || oldmsg)) {
     sdp->val.status.mark = UID_SEEN;
     save_str(&ctl->oldsaved, sdp->id, UID_SEEN);
 }

If the message gets removed from the server after
delivery but there is a problem in the same session
later on (and oldsaved is used to create .fetchids),
this entry will be stored in the file even though the
message is not on the server (but then again, it might
as some servers do not proceed with the deletion if
the session was not terminated correctly as I
understand).  It's not a problem though, the entry
will be garbage-collected next time.

I've tested it in my setup (specific server etc) but I
can't test it extensively on all kinds of email
servers in various situations...  Hope it's a change
straightforward enough to be considered.

F
 

--- "Eric S. Raymond" <esr(_at_)thyrsus(_dot_)com> wrote:
Frantisek Brabec <frb_97(_at_)yahoo(_dot_)com>:
Let's consider a situation (POP3 server, local
UIDL
management on) when there are 5 new messages on
the
server. Let's say 3 of them get downloaded
successfully and they get delivered ok. Then there
is
some problem afterwards that causes fetchmail
finish
with some error code (e.g., Protocol (4)).  In
such a
case, the procedure uid_swap_lists is not called
which
basically means that the .fetchids file will
remain
the same as it was before fetchmail's execution.
This
is despite the fact that several messages were
successfully retrieved and delivered.  This
results in
these messages being re-fetched and re-delivered
next
time fetchmail is run.

My question is, would it be possible to mark the
delivered messages as SEEN even though there was
an
unrelated error encountered during the same
session? 
I see two ways of doing it:
a) we can modify the code in driver.c (roughly
line
2350 in 5.7.5) so that when the SEEN flag is set
in
'ctl->newsaved', the same entry is also inserted
into
'newsaved' - for instance by adding the following
line:
  save_str(&ctl->oldsaved, sdp->id, UID_SEEN);
This way, the fact that this message was seen will
be
preserved for the next session regardless of
whether
.fetchids will be created from 'oldsaved' or
'newsaved'

b) If we cannot do uid_swap_lists because of
errors
(fetchmail.c, line 627 in 5.7.5), we could copy
all
entries from 'newsaved' marked as SEEN to
'oldsaved'
if they are not already there.

If you'll develop and test a patch for this, I'll
consider it.
-- 
              <a href="http://www.tuxedo.org/~esr/";>Eric S.
Raymond</a>

Morality is always the product of terror; its chains
and
strait-waistcoats are fashioned by those who dare
not trust others,
because they dare not trust themselves, to walk in
liberty.
      -- Aldous Huxley 


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/


<Prev in Thread] Current Thread [Next in Thread>