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
imaplib.py MAXLINE value is too low for gmail #67835
Comments
http://stackoverflow.com/q/28923997 and various other SO questions point out that imaplib's _MAXLINE value is a bit behind the times. Fine for 1997, when people had 10MB mailbox quotas, not so fine for the age of gmail. I'm tired of seeing those questions, so the attached patch increases the limit without abolishing it completely. There are also other issues in imaplib, but I fix just this one now, to test the waters so to speak. FWIW, I've signed the contributor form, just in case. |
Gmail breaks the standards again, eh? I suppose we'll have to accommodate them ;) |
The RFC in question is 2683, which isn't a standard, it's just advice. What gmail breaks is the expectation that mailboxes and seach results are smallish. If you run a python script on gmail and it runs a search, the result can be a great deal bigger than the author of RFC2683 foresaw. |
Sorry, I was being a facetious, but despite the smiley that wasn't clear. I *have* run into a number of cases where gmail violates the standard, but I wasn't really serious about this case. |
Now that I've had time to look at this, I see that in fact RFC2683 says nothing about what value MAXLINE should have, unless one is reasoning by analogy. It is concerned with *command line* lengths from the client to the server, not about server responses. It seems as though we really should be handling more or less arbitrary length lines in the server response. I'll bump up the limit in the meantime. |
New changeset a56aa567072c by R David Murray in branch '2.7': New changeset c1348ada8fc6 by R David Murray in branch '3.4': New changeset be6c4569f845 by R David Murray in branch 'default': |
You're entirely right. I should've reread 2683 too (a decade has passed since I read that). The danger with accepting the unlimited line length is that batch scripts might accept an infinitely large batch. Which is a matter of python culture, really. (This has been a very positive experience.) |
Yes, I agree that that is a concern. What should probably happen is that the maximum line length be a settable parameter with a "reasonable" default. It is too bad that (unlike say the SMTP protocol) the imap protocol does not address this directly. |
Length limits has actually been discussed and rejected; noone had a proposal that solved more problems than it introduced. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: