polo2ro / imapbox

Dump imap inbox to a local folder in a regular backupable format: html, json and attachements
MIT License
221 stars 47 forks source link

Fetch more than one message at a time #16

Open mrhyde opened 6 years ago

mrhyde commented 6 years ago

I have attempted to download a couple of thousands of emails I started wondering about speed limitations of imapbox. After a brief investigation, I have discovered that we are fetching only one message at the time.

@polo2ro did you tried to download emails in bulk? I wonder if that solution could be faster.

See the documentation:

The message_set options to commands below is a string specifying one or more messages to be acted upon. It may be a simple message number ('1'), a range of message numbers ('2:4'), or a group of non-contiguous ranges separated by commas ('1:3,6:9'). A range can contain an asterisk to indicate an infinite upper bound ('3:*').

polo2ro commented 6 years ago

Hi, no I did not try this feature yet, i don't know if this can be faster

axljung commented 2 weeks ago

Bulk fetch of emails will not speed up the whole process, because most of the time is consumed by converting to PDF and saving to the disk. And a bulk fetch of emails could break the limits of IMAP servers configured to not deliver too much data in one response.

I'm thinking about implementing a threaded work process doing the fetch in one thread and the processing of them to another one.