]> khamidou — GitHub mirrors - imapclient.git/commitdiff
Fixed bone-headed port handling error with interact functionality
authorMenno Smits <menno@freshfoo.com>
Mon, 3 Jun 2013 23:20:31 +0000 (00:20 +0100)
committerMenno Smits <menno@freshfoo.com>
Mon, 3 Jun 2013 23:20:31 +0000 (00:20 +0100)
When --ssl was passed without --port, port 143 was used, instead of
993!

imapclient/interact.py

index 9964e275cc22cee490ee7a5f832b59c3c9cd91cf..a28479833a2e93e335b7985f3c94867b72ee5e54 100644 (file)
@@ -21,7 +21,8 @@ def command_line():
     p.add_option('-p', '--password', dest='password', action='store',
                  help='Password to login with')
     p.add_option('-P', '--port', dest='port', action='store', type=int,
-                 default=None, help='IMAP port to use (default is 143)')
+                 default=None,
+                 help='IMAP port to use (default is 143, or 993 for SSL)')
     p.add_option('-s', '--ssl', dest='ssl', action='store_true', default=False,
                  help='Use SSL connection')
     p.add_option('-f', '--file', dest='file', action='store', default=None,
@@ -41,8 +42,6 @@ def command_line():
         for opt_name in ('host', 'username', 'password'):
             if not getattr(opts, opt_name):
                 setattr(opts, opt_name, getpass(opt_name + ': '))
-        if not opts.port:
-            opts.port = 143
         # Options not supported on the command line
         opts.oauth = False
         opts.oauth2 = False