Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scan-mailbox task looping on first 50 items #551

Closed
bjeanes opened this issue Jan 8, 2021 · 13 comments · Fixed by #558
Closed

scan-mailbox task looping on first 50 items #551

bjeanes opened this issue Jan 8, 2021 · 13 comments · Fixed by #558
Labels
bug Something isn't working or in unexpected ways

Comments

@bjeanes
Copy link
Contributor

bjeanes commented Jan 8, 2021

Job output makes this most clear. As you can see, while it states Searching next 50 mails it always reads the first 50 again and again:

2021-01-08T22:31:17: Start importing mails for user bjeanes
2021-01-08T22:31:18: Reading mails for user bjeanes from gmail-bo/[Gmail]/All Mail
2021-01-08T22:31:21: Processing folder [Gmail]/All Mail
2021-01-08T22:31:22: Searching next 50 mails in All Mail.
2021-01-08T22:32:35: Found 57565 mails in folder. Reading first 50
2021-01-08T22:32:35: Filtering mails on subject using filter: invoice|receipt|tax|payment
2021-01-08T22:32:35: Excluding mail '[nhnenews] Armadas Of Giant Jelly Fish Invade Sea Of Japan', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Re: DW8 jp', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Re: DW8 jp', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'cancel membership [Incident: 051207-000810]', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Concerning your AudibleListener account', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Cancellation [Incident: 051207-000810]', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'val flowers', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'May have been my end...', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Re: New Layouts?', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'pics', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'You Have Successfully Added a Bank Account', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Congratulations, you now have Plaxo!', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'more pics', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'more pics', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Re: our very long list', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Re: our very long list', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Confirm your e-mail address', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'FW: Interesting Articles About Google', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Topic Reply Notification - solutions to (auto-)start of mampp', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'kisses', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Bank Account Invalid', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'this is becoming a daily thing innit?', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'PayPal Electronic Funds Transfer', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'more pics', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Bank Account Invalid', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Satisfied with our Service?', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'hey there bo', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Fwd: Looks can be deceiving...', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'C43904628 - 1&1 Internet Inc. Billing Re: Declined debit note', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Chart to PDF', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Re: what's cuter?', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Order for contents', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Reminder 11/30/2005', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Looks can be deceiving...', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Re: Declined debit note', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'You Have Successfully Added a Bank Account', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Re: Pod flash', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Re: Take these ones out', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Declined debit note ', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'FW: 300 hours poses, the rest', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Sequences for formatting for manual', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Order of poses with photos', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Google Analytics: Service Announcement', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Take these ones out', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'what's cuter?', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Re: Html emailer', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Take these once out', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Re: Html emailer', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Pod flash', it doesn't match the filter.
2021-01-08T22:32:35: Excluding mail 'Html emailer', it doesn't match the filter.
2021-01-08T22:32:37: Processing folder [Gmail]/All Mail
2021-01-08T22:32:38: Searching next 50 mails in All Mail.
2021-01-08T22:33:48: Found 57565 mails in folder. Reading first 50
2021-01-08T22:33:48: Filtering mails on subject using filter: invoice|receipt|tax|payment
2021-01-08T22:33:48: Excluding mail '[nhnenews] Armadas Of Giant Jelly Fish Invade Sea Of Japan', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Re: DW8 jp', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Re: DW8 jp', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'cancel membership [Incident: 051207-000810]', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Concerning your AudibleListener account', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Cancellation [Incident: 051207-000810]', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'val flowers', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'May have been my end...', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Re: New Layouts?', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'pics', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'You Have Successfully Added a Bank Account', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Congratulations, you now have Plaxo!', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'more pics', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'more pics', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Re: our very long list', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Re: our very long list', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Confirm your e-mail address', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'FW: Interesting Articles About Google', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Topic Reply Notification - solutions to (auto-)start of mampp', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'kisses', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Bank Account Invalid', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'this is becoming a daily thing innit?', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'PayPal Electronic Funds Transfer', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'more pics', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Bank Account Invalid', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Satisfied with our Service?', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'hey there bo', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Fwd: Looks can be deceiving...', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'C43904628 - 1&1 Internet Inc. Billing Re: Declined debit note', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Chart to PDF', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Re: what's cuter?', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Order for contents', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Reminder 11/30/2005', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Looks can be deceiving...', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Re: Declined debit note', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'You Have Successfully Added a Bank Account', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Re: Pod flash', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Re: Take these ones out', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Declined debit note ', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'FW: 300 hours poses, the rest', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Sequences for formatting for manual', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Order of poses with photos', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Google Analytics: Service Announcement', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Take these ones out', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'what's cuter?', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Re: Html emailer', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Take these once out', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Re: Html emailer', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Pod flash', it doesn't match the filter.
2021-01-08T22:33:48: Excluding mail 'Html emailer', it doesn't match the filter.
2021-01-08T22:33:50: Processing folder [Gmail]/All Mail
2021-01-08T22:33:50: Searching next 50 mails in All Mail.
2021-01-08T22:35:00: Found 57565 mails in folder. Reading first 50
2021-01-08T22:35:00: Filtering mails on subject using filter: invoice|receipt|tax|payment
2021-01-08T22:35:00: Excluding mail '[nhnenews] Armadas Of Giant Jelly Fish Invade Sea Of Japan', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Re: DW8 jp', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Re: DW8 jp', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'cancel membership [Incident: 051207-000810]', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Concerning your AudibleListener account', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Cancellation [Incident: 051207-000810]', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'val flowers', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'May have been my end...', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Re: New Layouts?', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'pics', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'You Have Successfully Added a Bank Account', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Congratulations, you now have Plaxo!', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'more pics', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'more pics', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Re: our very long list', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Re: our very long list', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Confirm your e-mail address', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'FW: Interesting Articles About Google', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Topic Reply Notification - solutions to (auto-)start of mampp', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'kisses', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Bank Account Invalid', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'this is becoming a daily thing innit?', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'PayPal Electronic Funds Transfer', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'more pics', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Bank Account Invalid', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Satisfied with our Service?', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'hey there bo', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Fwd: Looks can be deceiving...', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'C43904628 - 1&1 Internet Inc. Billing Re: Declined debit note', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Chart to PDF', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Re: what's cuter?', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Order for contents', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Reminder 11/30/2005', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Looks can be deceiving...', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Re: Declined debit note', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'You Have Successfully Added a Bank Account', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Re: Pod flash', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Re: Take these ones out', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Declined debit note ', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'FW: 300 hours poses, the rest', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Sequences for formatting for manual', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Order of poses with photos', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Google Analytics: Service Announcement', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Take these ones out', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'what's cuter?', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Re: Html emailer', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Take these once out', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Re: Html emailer', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Pod flash', it doesn't match the filter.
2021-01-08T22:35:00: Excluding mail 'Html emailer', it doesn't match the filter.
@bjeanes
Copy link
Contributor Author

bjeanes commented Jan 8, 2021

Also, the output for a task should probably have a max-height and overflow: auto/overflow: scroll on it. I left this running and then I had to scroll forever to get to the cancel button, then halfway back up the page to get to the confirmation overlay.

@eikek
Copy link
Owner

eikek commented Jan 8, 2021

Hi @bjeanes , thanks for reporting! I'm looking into it! I suspect that the exclusion filter is not taken into account when going to the next batch.

And yeah, the whole job/queue view is still in its earliest version…. I do have the desire to improve that. Some css can help a little already, I will see that I add it right away. It is currently not designed for large output. So there will be some deeper changes in the future.

@eikek eikek added the bug Something isn't working or in unexpected ways label Jan 8, 2021
@eikek
Copy link
Owner

eikek commented Jan 8, 2021

What kind of settings did you use (subject filter? are mails moved or deleted? etc) Thanks!

@bjeanes
Copy link
Contributor Author

bjeanes commented Jan 8, 2021

  • Folders: [Gmail]/All Mail (I'll probably make this just inbox down the line, but wanted to see how it went slurping in a decade or more of historical emails 👀 )
  • Target folder: blank
  • Delete imported mails: unchecked
  • File filter: blank
  • Subject filter: invoice|receipt|tax|payment (though, not sure if this needs to be *(invoice|receipt|tax|payment)* or similar to match, given the example is *Scanned Document* not just Scanned Document)
  • Item direction: Automatic
  • Language: English
  • Schedule: * * * 00 : 00

Anything I didn't mention is blank

@eikek
Copy link
Owner

eikek commented Jan 8, 2021

Thank you very much! The glob invoice|receipt would only match exactly "invoice" and "receipt". You might wanted to mean *invoice*|*receipt*|*tax* which matches strings that contain any of these words.

I think part of the problem is that you currently need to move the "done" mails out of the way. But the thing is that the subject filter is applied before they are moved or deleted, so this doesn't help in your case :( Going to fix that. But I think you need to still define a target folder to move processed mails to. It is currently implemented by searching again and again to not hold onto a connection for too long (some mail servers are picky, but defaults may be too small?). It expects to not find the previous mails again. However, you can set this limit yourself in the config file (see mail-chunk-size and max-mails).

@bjeanes
Copy link
Contributor Author

bjeanes commented Jan 8, 2021

Gotcha... You might need to make target folder required in that case.

Unfortunately, that's also kind of a deal breaker, as this is my personal inbox, not just a a dummy receptacle for documents. I don't want it moving/re-organising at all.

My expectation as a new user was that this would work by using send dates as a type of cursor:

  • Fetch emails sorted by date (oldest first)
  • Process all items and record the newest date seen
  • Fetch next batch by filtering for "after:"

This may be a misunderstanding of the capabilities of IMAP on my part, but it was my understanding that it was designed to constrain results in such a way, even if it doesn't have official "pagination" per se.

Thank you very much! The glob invoice|receipt would only match exactly "invoice" and "receipt". You might wanted to mean *invoice*|*receipt*|*tax* which matches strings that contain any of these words.

Ack!

@bjeanes
Copy link
Contributor Author

bjeanes commented Jan 8, 2021

Perhaps I can use GMail filters to match on my search terms and apply a label, configure Docspell to search the "folder" for that label and essentially remove the label after it is processed.

This could work, but would be highly GMail-specific, and I don't plan to stay with GMail if I can help it.

@eikek
Copy link
Owner

eikek commented Jan 9, 2021

Yes, I see your concern. The date filter is sure an option. IMAP supports this in the protocol afaik, but not all imap servers implement it. Then the imap servers just send all mails and you have to filter in memory…. Guess (or hope) this is rare, it can be simply an option and users need to decide then. It complicates it because now the task needs to memorize something in between (the state is not externalized). I will create a separate ticket to find a solution for better bulk-importing.

Another workaround for now would be to use real sync tools like mbync or offlineimap and then upload the files via ds cli tool.

You currently have the option to delete the mail or to move it away; or to let the "received since" and the timer expression work together, like scan mails every 6hours and search for received>now-6hours…. That's why its not required, but I do see that this is quite inconvenient…. The idea was more to periodically get the newest mails and not so much for bulk-importing.

@eikek eikek added this to the Docspell 0.18.0 milestone Jan 9, 2021
@bjeanes
Copy link
Contributor Author

bjeanes commented Jan 9, 2021

I've noticed based on Elm and Scala use that you're of the FP persuasion.

Thinking in an FP way... one option is to only have the scan job do its own batch, and then enqueue the next batch with a parameter. That way, you don't need state. Each scheduled task always starts from beginning of mailbox.

The "Scan Mailbox" settings page already has a Received Since Hours input, so it would essentially be the same thing here, except you parameterise the job with that starting timestamp and instead of looping in the job, you recur (create a new job) with a different mail offset.

For my use case, I'd do a single run with Received Since Hours unset, let it recur through the whole mailbox, then tweak that setting to be 24 hours or whatever for the ongoing work.

@eikek
Copy link
Owner

eikek commented Jan 9, 2021

Yes, thanks, it works like this already as you said. I can just emit new jobs with the next batch, or I can re-search in a loop (it is done like this currently). I can think of problems still: It may occur that I don't get an ordered list of mails back, such that I don't know for sure whether the last mail is the one with the "newest" date. And even when I'm submitting new jobs or re-search, there will come the time when the job gets submitted anew starting over – it is designed to be a periodic job. Then it will start all over and re-read all mails. So I was thinking to provide a separate task for bulk-importing mails as a one-time job instead?

@bjeanes
Copy link
Contributor Author

bjeanes commented Jan 9, 2021

So I was thinking to provide a separate task for bulk-importing mails as a one-time job instead?

That seems useful.

Then it will start all over and re-read all mails.

Yeah, until/unless you do something like a specific one-off job as you suggest, I think it's still workable as I said by blanking the Received Since Hours field, clicking the existing run once, then re-filling Received Since Hours :)

I think emit new jobs for new batch instead of looping, because for VERY large inboxes, this ties up the job executor for a long time and a shutdown of the executor would lose the state. Lots of smaller jobs are more flexible with execution and scheduling.

It may occur that I don't get an ordered list of mails back, such that I don't know for sure whether the last mail is the one with the "newest" date.

Yeah that will be a bit annoying. Ideally, if you are getting say 50 things back, you can check if they are sorted. If not, assume you can't trust dates as a cursor and raise an error perhaps. Or revert to a more naive import.

@eikek
Copy link
Owner

eikek commented Jan 9, 2021

I think emit new jobs for new batch instead of looping, because for VERY large inboxes, this ties up the job executor for a long time and a shutdown of the executor would lose the state. Lots of smaller jobs are more flexible with execution and scheduling.

Yes definitely! I would do the bulk-import a bit differently, exactly as you said. The existing job is meant to be able to get restarted and called periodically. It currently "loops" over batches but stops after a certain amount of mails have been submitted to processing. The next periodic run can then start from there.

I think it's still workable as I said by blanking the Received Since Hours field, clicking the existing run once, then re-filling Received Since Hours :)

Yes it could work like this, but it has the problems mentioned before. If it starts new jobs it can easily interfere with the periodic run. You would need to regularly monitor the processing to see whether the "whole" job is done or not. Because if not, it is unsafe to enable the same periodic job. Then it might mean that "run once" works a bit differently (submit jobs) compared to "periodic" (not submit jobs). It would be confusing I think… Otoh if it does everything in one run it can easily block the executor for a long time, meaning that other jobs can't run on lower hardware (if there is just one joex thread).

When submitting many smaller jobs, it still means that it depends on some stored criteria (whether it is fp or not doesn't matter much imho). It must be ensured that it retrieves mails in some order, so it might be unsafe to provide too many options for filtering to the user (when thinking to run periodically). In the current situation, it is ok, because the "central" mailbox itself is synchronized. But this is just more a feeling right now, I might be wrong here, have to think a bit more :). In my feeling the cases "import all" and things like "import newest mails daily" is very different scenario.

eikek added a commit that referenced this issue Jan 9, 2021
When skipping mails due to a filter, it must still enter the
post-handling step. Otherwise it will be seen again on next run.

Issue: #551
eikek added a commit that referenced this issue Jan 9, 2021
When skipping mails due to a filter, it must still enter the
post-handling step. Otherwise it will be seen again on next run.

Issue: #551
eikek added a commit that referenced this issue Jan 9, 2021
When skipping mails due to a filter, it must still enter the
post-handling step. Otherwise it will be seen again on next run.

Issue: #551
@eikek eikek mentioned this issue Jan 9, 2021
@mergify mergify bot closed this as completed in #558 Jan 9, 2021
@eikek
Copy link
Owner

eikek commented Jan 9, 2021

I closed this, because it now should work when moving mails away or when choosing a large batch via config. I created #557 for a better bulk-import.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working or in unexpected ways
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants