Re: I want to retrieve the last few days not the whole inbox

Charles Cazabon <[email protected]> Sat, 22 Jan 2022 22:39:15 -0600
Newsgroups gmane.mail.getmail.user
Message-ID <[email protected]>
Donald MacDougall <[email protected]> wrote:
> > > I have a lot of mail in my inbox and I want to retrieve only the last
> > > few days, not the whole inbox to a fresh getmail install.  I can't find
> > > where getmail saves the last message it retrieved so I can set which
> > > message I'd like it to start at.
[...]
> I'm not sure I understand.  I don't want to tell the IMAP server where to
> start, I want to tell getmail to pretend it has already seem most messages
> and just start at message x.

There is no stable "message X" index value which a client could use to do
this.  getmail remembers a message based on the folder it is in (for IMAP) and
it's uniquely-assigned identifier as provided by the server.  This is an
arbitrary ID; it's not a monotonically incrementing counter, so you can't say
"I have message to X, so start retrieving at X+1".

> It seems to me that it usually will tell me so many messages retrieved, so
> many messages skipped.

It tells you N messages skipped because the server offered those message
(identified by the unique ID) and getmail looked in its local data and said
"aha, I've already seen message <unique-id> in folder <folder>, so I'll skip
that one".

> So I figured it must have saved the number of messages to skip somewhere

Nope.  That's not how POP and IMAP work.

> Maybe I have a misunderstanding about how it decides what to skip

Yes - there's no reason for most users to even think about this, so it's easy
to make false assumptions.

Charles
-- 
-----------------------------------------------------------------------
Charles Cazabon
GPL'ed software available at:               http://pyropus.ca/software/
-----------------------------------------------------------------------