Opened 2 years ago

Closed 2 years ago

#5697 enhancement closed fixed (fixed)

Make the mail example imap4client.py compatible with servers require SSL

Reported by: argonemyth Owned by: itamar
Priority: normal Milestone:
Component: mail Keywords: documentation example review
Cc: jesstess Branch: branches/imap-example-5697
(diff, github, buildbot, log)
Author: itamarst Launchpad Bug:

Description

The example only works with an IMAP server that doesn't require SSL. The script hangs if you try to access servers like imap.gmail.com. I guess a lot of people might try Gmail with this script, it's better to make it compatible with servers that require SSL.

The script should also stop the reactor once the job is finished.

Attachments (1)

5697-imap4client-20120612.patch (7.0 KB) - added by argonemyth 2 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 2 years ago by argonemyth

  • Keywords review added
  • Owner argonemyth deleted

The main reason why it hangs when you try to connect to a Gmail account is that it doesn't initiate a SSL connection if you only change the port number to 993. I fixed the issue by using reactor.connectSSL if an user input '993' as the port number.

A note on Gmail! It's been using 'XOAUTH' as authentication method since 2010. So, only 'clear-text' (the insecure way) is available for gmail accounts. I tested the script on an IMAP server that supports PLAIN auth, worked well.

I also modified the example a bit to fit the coding standard. Please review (5697-imap4client-20120612.patch), Thanks!

Changed 2 years ago by argonemyth

comment:2 Changed 2 years ago by itamar

  • Owner set to itamar

comment:3 Changed 2 years ago by itamarst

  • Author set to itamarst
  • Branch set to branches/imap-example-5697

(In [34752]) Branching to 'imap-example-5697'

comment:4 Changed 2 years ago by itamarst

  • Resolution set to fixed
  • Status changed from new to closed

(In [34756]) Merge imap-example-5697: Improvements to the IMAP client example.

Author: argonemyth
Reviewer: itamar
Fixes: #5697

Note: See TracTickets for help on using tickets.