Giter Club home page Giter Club logo

Comments (6)

tonioo avatar tonioo commented on August 12, 2024

Hi,
this issue has been reported with large mailboxes... Currently, I don't have a quick fix for it.

from modoboa-webmail.

vingeni avatar vingeni commented on August 12, 2024

With the master HEAD version of webmail, I am able to read an inbox with more than 18000 emails.
I also tried to fullfill my inbox with big mails, but in my case, it works.

If somebody reproduce this bug, please, attach a full callstack.

from modoboa-webmail.

vingeni avatar vingeni commented on August 12, 2024

The bug is not reproductible with older versions of python (not reproductible on debian wheezy) and is due to a commit from september 2013 in python imaplib module.

This bug is due to a limitation added on server responses into the python's imaplib module : http://bugs.python.org/issue16039. Now the response line from an imap server must not exeed 10000 bytes. And in a case of a SEARCH or SORT on a mailbox which contains a lot of messages, this limit is reached.

By reading the IMAP rfc2683 pointed by the python's issue, I think there is a misinterpretation from team maintaining the imaplib module : the RFC defines this size limitation for clients commands and not for server responses.

The rfc2683 does not define any server response size limitation, it only underlines, in section 3.2.1, the risk that a client may generate requests that results in very large responses (so we are not a bug from dovecot imap server).

If you decide to replace the standard imaplib module with some other, then the new imap module must no rely on the standard imaplib if you want to be sure to not fall again in this bug.

I found two workarounds :

  1. You can simply change the default imap._MAXLINE value to a bigger value (e.g: multiply the original value by 10 or 100), At lease, one other opensource project has done it (e.g : IMAPdedup).
  2. This response size limitation has only been implemented in the IMAP4.readline function, and not in the IMAP4_SSL.readline, which means, you won't have the bug by using SSL. But then you can fall in the issue16039 the python's team tried to fix.

My suggestions are :

  • set imaplib._MAXLINE to 100000,
  • open a bug on python imaplib module,
  • look for a python imap module, not based on imaplib.

from modoboa-webmail.

vingeni avatar vingeni commented on August 12, 2024

In fact, there is already a discution on this imaplib._MAXLIMIT on the python's team side : http://bugs.python.org/issue23647
So this limitation issue will probably disappear with newer python versions.

from modoboa-webmail.

vingeni avatar vingeni commented on August 12, 2024

the SSL workaround is not anymore present on latest python version (3.4.3), so it is not a good solution.

from modoboa-webmail.

tonioo avatar tonioo commented on August 12, 2024

Many thanks for this explanation!

I think we can begin with a "monkey patch" of the std imaplib (your suggestion). In the future, if we want a better webmail, we will have to implement (or find) a new client.

from modoboa-webmail.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.