"Eric W. Biederman" <[email protected]> wrote:
> Eric Wong <[email protected]> writes:
>
> > "Eric W. Biederman" <[email protected]> wrote:
> >> my $tracker = PublicInbox::IMAPTracker->new();
> >
> > Thanks. What's PublicInbox::IMAPTracker?
>
> Something that keeps the last fetched UID in an sqlite database.
> I will follow up with a patch for that as well.
Thanks!
> I haven't been brave enough to let this script delete any mail
> yet so I need to track what has been fetched. Something that
> will be rolled back if the email message isn't commited into git.
>
> I have a companion script that will delete mail.
Yup. I also don't trust and don't want somebody trusting my
code when it comes to deleting stuff.
So I've also been considering a script which deletes mail from
my Maildirs/IMAP folders if a ContentId matches what's in a
known public-inbox, perhaps after a certain time...
> I mostly sent it so that there is some idea what I am working with.
>
> In context of this discussion I don't remember how often I am looking at
> the "Delivered-To:" header. That is almost gone but I know for a while
> I was using that as well.
>
> >> for (;;imap_sleep()) {
> >> # Run fetch_mail in it's own separate process so
> >> # that if something goes wrong the process exits
> >> # and everything cleans up properly.
> >> #
> >> # Running fetch_mail in an eval block is not enough
> >> # to prevent leaks of locks and other resources.
> >
> > I was thinking along the same lines :)
> >
> > The rest looked good and it's definitely something I can work
> > with to get supportable in a way that reuses git's credential
> > system and configs.
>
> I think fundamentally the script sucks because it is one email message
> at a time (not using IMAPs overlapping), the script is polling (NOT
> using IMAP idle), and I have magic to go from the server that I need
> to fetch to the actual domain.
Yeah, IMAP client libraries are pretty disappointing
considering what the protocol is capable of.
I just checked libcurl and I don't see that it supports
IMAP IDLE, either; and honestly I'm not sure how to add
it since curl is more intended for URLs.
> But in practice the script seems to be working reliably even in the
> event of an error right now.
Cool. Perfect is the enemy of good, after all :>
--
unsubscribe: [email protected]
archive: https://public-inbox.org/meta/