[issue23906] poplib maxline behaviour may be wrong

2015-07-24 Thread Chris Smowton

Chris Smowton added the comment:

Created #24706 to describe the unflushed connection problem.

--

___
Python tracker 
<http://bugs.python.org/issue23906>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24706] poplib: Line too long error causes knock-on failure to retrieve all subsequent messages

2015-07-24 Thread Chris Smowton

New submission from Chris Smowton:

As mentioned in #23906, when poplib bails from receiving a message with a 'line 
too long' error it neither flushes nor re-establishes the TCP connection. This 
means that subsequent commands fail because instead of the expected response we 
receive part of the unflushed data from the message that triggered the original 
error.

--
components: Library (Lib)
messages: 247283
nosy: Chris Smowton
priority: normal
severity: normal
status: open
title: poplib: Line too long error causes knock-on failure to retrieve all 
subsequent messages
versions: Python 2.7

___
Python tracker 
<http://bugs.python.org/issue24706>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23906] poplib maxline behaviour may be wrong

2015-07-24 Thread Chris Smowton

Chris Smowton added the comment:

Why wouldn't that fix the problem? The issue is poplib not tolerating server 
behaviour seen in the wild, and if you limit by message size not line length 
you shouldn't see this problem?

(Side note, I'm surprised not to have been emailed when you replied, any idea 
what I'm missing?)

--

___
Python tracker 
<http://bugs.python.org/issue23906>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16041] poplib: unlimited readline() from connection

2015-07-14 Thread Chris Smowton

Chris Smowton added the comment:

+1 to the above; suggest this should be rolled back and replaced with a total 
message size limit.

--
nosy: +Chris Smowton

___
Python tracker 
<http://bugs.python.org/issue16041>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23906] poplib maxline behaviour may be wrong

2015-07-14 Thread Chris Smowton

Chris Smowton added the comment:

I found the same problem retrieving mail from my ISP's (unknown) POP3 server. I 
was sent an HTML email as one long 50KB line, which naturally broke everything.

Instead of limiting line length, I suggest you should limit total message body 
size, since that's what you're actually trying to defend against here. You 
could also either use the +OK XXX octets line to set a more conservative limit 
(and fail fast if it announces intent to send more than your limit).

As above the workaround was to insert import poplib; poplib._MAXLINE = 100 
at the top of the 'getmail' script.

A side-note: one message that is broken this way causes all future messages to 
fail because poplib does not flush the connection when bailing due to a 'line 
too long' error. If it isn't prepared to read the rest of the incoming data, it 
*must* hang up the connection and re-login to fetch the next message.

--
nosy: +Chris Smowton

___
Python tracker 
<http://bugs.python.org/issue23906>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com