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.
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.
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.
But in practice the script seems to be working reliably even in the
event of an error right now.
Eric
--
unsubscribe: [email protected]
archive: https://public-inbox.org/meta/