fetchmail-friends
[Top] [All Lists]

[fetchmail] Re: POP3 LAST vs UIDL

2003-10-15 05:36:25
Quoting from Matthias Andree's mail on Wed, Oct 15, 2003 at 02:29:49AM +0200:
I am not sure what filename convention you are looking at.

No concrete plans yet. Anything that fits the POSIX portable file name
character set is fine.

server-login-folder might work, with proper escaping (maybe _2F for /,
similar to quoted-printable), but then again it might be REALLY
lengthy. Maybe an MD5 hash and a separate informative file (for human
consumption as well) that prints the hash, server, login and folder. But
MD5 might collide, so it's not perfect. Maybe a counter would work,
although then file opening becomes expensive. Open the file, read a few
lines to figure if it's the right... quite a effort.

Yes. A counter (or mkstemp()) will be required for uniqueness.

I suggest the following format for each id file (the filename will be
ignored in this format). Each id file will have a parameter section
which the relevant information about the mailbox.

server=my.mailserver.com
user=myaccountname
protocol=imap
mailbox=themailboxname              # IMAP only, the mailbox is not "INBOX"
uidvalidity=themailboxid    # IMAP only, if this changes clear the uid list
slowuidl=yes                        # POP3 only, the ids are based on slow 
uidl

I'd suggest we kill anything that is not "real UIDL". It's no good to
carry dead code around.

Ok.

The optional parameters could include information specific to some
ids.

Free-form calls for an expensive parser. I'm not a friend of such things.

I was thinking of using lex (or, do I mean yacc?). Not sure if one can
use lex for two different file formats (the rcfile and the idfile(s))
in the same program. ... Aha ... bison does have a section "Multiple
Parsers in the Same Program" ...

id4 1066026934 deleted=yes  # this mail was deleted, but did not
                            # get expunged, possibly due to socket error.

"D" would do.

I am trying to keep the same format as the parameter section.


id5 1066026935 errors=3             # there was an error in downloading
                            # this mail in the last 3 polls. If
                            # the count reaches a limit (say 5),
                            # this mail will be skipped over. Such
                            # mails can then be downloaded by
                            # increasing the limit through a
                            # command line option.

No need.

There was a mail with binary characters. For some reason (did not
debug it), sendmail was abruptly closing connection while receiving
the mail. fetchmail used to get a SIGPIPE and terminate the
connection. Mails after that never got downloaded until the offending
mail was deleted from the mailserver.

If there is a count of errors like the above, it is possible to skip
over such problematic mails which have repeated delivery problems.

id6 1066026936 size=1000000 # this mail of size 1 Mb was
                            # skipped over because of 'limit'.
                            # This mail will be skipped over
                            # unless the 'limit' option is changed
                            # to allow this mail.

This is to mainly avoid a binary search of UIDs hitting a mail which
was skipped over (the 'fastuidl' patch). If there are 100 mails, of
which the 50th mail has been skipped over because of 'limit',
fetchmail will get the UIDs of all mails from 50 onwards quite
unnecessarily.

The id file can also be used for keeping track of multidrop mails
which had delivery problems for some recipients only. Say, there is a
mail for two recipients and there is a transient error for one
recipient only, fetchmail could mark that delivery was successful for
the other recipient and not deliver the mail to that recipient again
in the next poll.

-- 
Sunil Shetye.