From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 2EC631F4BD; Thu, 10 Oct 2019 08:31:34 +0000 (UTC) Date: Thu, 10 Oct 2019 08:31:32 +0000 From: Eric Wong To: "Eric W. Biederman" Cc: Alyssa Ross , meta@public-inbox.org Subject: Re: Do I need multiple publicinbox..address values? Message-ID: <20191010083132.GA14886@ailurophile> References: <87imp05hlm.fsf@alyssa.is> <20191008001050.rwd7bh7cek7qrydi@dcvr> <87wodfctwd.fsf@x220.int.ebiederm.org> <20191008221108.3wsso25kviiwd7ek@dcvr> <87wodec1um.fsf@x220.int.ebiederm.org> <20191008224104.GA24142@dcvr> <87h84ibb9m.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87h84ibb9m.fsf@x220.int.ebiederm.org> List-Id: "Eric W. Biederman" wrote: > Eric Wong writes: > > > "Eric W. Biederman" 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 :>