This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: imap lib server compabilities
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: eric.smith, r.david.murray, silversky
Priority: normal Keywords:

Created on 2010-12-13 12:11 by silversky, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
debug.txt silversky, 2010-12-13 12:11 debug information + traceback + telnet log
Messages (10)
msg123871 - (view) Author: Yevgeniy (silversky) Date: 2010-12-13 12:11
When i trying to connect to courier-imap server i got error:
"server not IMAP4 compliant"
But as i see in the debug information and server responses there is error in the source code of library.
imaplib.py version: 2.58 
courier-imap server version: 0.91-ubuntu1
os version: ubunto 10.04(lucid)
You can see debug information and telnet session in attached file.
Best regards, Yevgeniy.
msg123878 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-12-13 14:51
Where does the non-telnet part of your trace come from?  How did you produce it?  Does this error still occur using 2.7?  (Python 2.6 is in security fix only mode at this point.)
msg123919 - (view) Author: Yevgeniy (silversky) Date: 2010-12-14 02:37
>Where does the non-telnet part of your trace come from?  How did you produce it?
When i got this error i set Debug = 5 in imaplib.py
and run next code:
import imaplib
M = imaplib.IMAP4_SSL('localhost')
M.login('username', 'password')
M.logout()

>Does this error still occur using 2.7?
Yes

As i see in debug information: CAPABILITIES: ('0', 'ACL', 'ACL2=UNION')
but in the telnet session i see next answer:
* CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS LOGINDISABLED
Because of this i think that we have maybe some kind of error in the source code of library.
p.s. sorry for my English )
msg123921 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-12-14 03:07
Well, in that case your telnet session doesn't tell us all that much, since you are using IMAP4_SSL in the Python but regular non-SSL in the telnet session.  Are you sure it is even the same server running on the SSL port?
msg123922 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-12-14 03:11
By the way, an SSL login runs just fine for me against my Courier-IMAP server.  Does regular IMAP work for you?
msg123927 - (view) Author: Yevgeniy (silversky) Date: 2010-12-14 05:41
> By the way, an SSL login runs just fine for me against my Courier-IMAP server.  Does regular IMAP work for you?
No it dose not.
When i run:
M = myimaplib.IMAP4(host)
M.login(username, password)
I got "error: STARTTLS required"
msg123939 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-12-14 13:45
Starttls support was only added in Python 3.2.  Apparently your server is set to disallow non-SSL connections.

Have you confirmed that the same server is listening on port 993 as is listening on port 143?  The debug info from imaplib makes it look like different capability information is being returned, though the banner does look the same.

Please run the regular IMAP4 test with debug on, I think it may be getting past the capabilities query before it produces the starttls error, and if so it would be interesting to compare the two debug traces.
msg124012 - (view) Author: Yevgeniy (silversky) Date: 2010-12-15 10:20
>Have you confirmed that the same server is listening on port 993 as is listening on port 143? 
I found that is mistake in courier-imap(-ssl) configuration.
I have some troubles with it configuring(may by incorrect certificates).
When i make right configuration i will test again python code and writе here results.
msg124112 - (view) Author: Yevgeniy (silversky) Date: 2010-12-16 08:20
I found than it is server configuration problem.
When i add variable IMAP_COPABILITY to /etc/courier/imapd-ssl all troubles are gone. Variable did not exported from /etc/courier/imapd, but documentation sad that it imports automatically.
Thank you very much for your attention and help.
msg124125 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-12-16 13:07
You are welcome.  Glad you were able to solve it.
History
Date User Action Args
2022-04-11 14:57:10adminsetgithub: 54901
2010-12-16 13:07:30r.david.murraysetmessages: + msg124125
resolution: not a bug
stage: test needed -> resolved
2010-12-16 08:20:08silverskysetstatus: open -> closed

messages: + msg124112
2010-12-15 10:20:32silverskysetmessages: + msg124012
2010-12-14 13:46:16r.david.murraysetversions: + Python 2.7, - Python 2.6
2010-12-14 13:45:49r.david.murraysetmessages: + msg123939
2010-12-14 05:41:08silverskysetmessages: + msg123927
2010-12-14 03:11:04r.david.murraysetmessages: + msg123922
2010-12-14 03:07:29r.david.murraysetmessages: + msg123921
2010-12-14 02:37:13silverskysetmessages: + msg123919
2010-12-13 14:51:42r.david.murraysetnosy: + eric.smith, r.david.murray
messages: + msg123878

type: performance -> behavior
stage: test needed
2010-12-13 12:11:42silverskycreate