From: Sunil S. <sun...@ro...> - 2011-04-24 16:37:53
|
Hi Andrea Righi, > To retrieve new messages from a IMAP > folder we use the IMAP SEARCH > command, but we limit the messages processed by the query > to 1000. > This limit is hard-coded and it cannot be changed at > runtime. > > This value is not the best option in some cases, especially > for large > folders, because we need to submit a query each 1000 > messages. > > The following patch introduces a new option (imapsearchmax) > that can be > used to change this limit at runtime. You are missing the point of why there is a limit of 1000 in the IMAP SEARCH command. There is a risk of response truncation when there are more than 1860 new messages in the IMAP folder if the limit is not imposed. To truly test your patch, get a huge mailbox with all new messages(*) and check how many mails get skipped during the first poll. You may even find some mails getting downloaded twice in some edge cases. However, I understand the unnecessary delay in the case when there are very few messages. I will see if there is a better approach than the one currently implemented to avoid the delay as well as proceed in a safer manner. -- Sunil Shetye. (*) Or you may set up a test mailbox, copy existing 10000+ messages to that folder, mark all of them as unread, and test your patch on that folder with the imapsearchmax parameter set to 10000. Note how many messages (including duplicates) get downloaded in one poll of that folder. |