diff roundup/scripts/roundup_mailgw.py @ 3779:ee73abcc95d2

Sorry, another mega-patch: - clarified windows service documentation (patch [SF#1597713]) - HTMLClass fixed to work with new item permissions check [SF#1602983] - support POP over SSL (patch [SF#1597703])
author Richard Jones <richard@users.sourceforge.net>
date Wed, 13 Dec 2006 23:32:39 +0000
parents 22ec8e91da2b
children 39af38d6f77d
line wrap: on
line diff
--- a/roundup/scripts/roundup_mailgw.py	Tue Dec 12 05:15:44 2006 +0000
+++ b/roundup/scripts/roundup_mailgw.py	Wed Dec 13 23:32:39 2006 +0000
@@ -14,7 +14,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 #
-# $Id: roundup_mailgw.py,v 1.22 2006-07-15 10:08:01 schlatterbeck Exp $
+# $Id: roundup_mailgw.py,v 1.23 2006-12-13 23:32:39 richard Exp $
 
 """Command-line script stub that calls the roundup.mailgw.
 """
@@ -78,6 +78,10 @@
  are both valid. The username and/or password will be prompted for if
  not supplied on the command-line.
 
+POPS:
+ Connect to a POP server over ssl. This requires python 2.4 or later.
+ This supports the same notation as POP.
+
 APOP:
  Same as POP, but using Authenticated POP:
     apop username:password@server
@@ -154,12 +158,15 @@
 
         if source == 'mailbox':
             return handler.do_mailbox(specification)
-        elif source == 'pop':
+        elif source == 'pop' or source == 'pops':
             m = re.match(r'((?P<user>[^:]+)(:(?P<pass>.+))?@)?(?P<server>.+)',
                 specification)
             if m:
+                ssl = source.endswith('s')
+                if ssl and sys.version_info<(2,4):
+                    return usage(argv, _('Error: a later version of python is required'))
                 return handler.do_pop(m.group('server'), m.group('user'),
-                    m.group('pass'))
+                    m.group('pass'),ssl)
             return usage(argv, _('Error: pop specification not valid'))
         elif source == 'apop':
             m = re.match(r'((?P<user>[^:]+)(:(?P<pass>.+))?@)?(?P<server>.+)',
@@ -172,9 +179,7 @@
             m = re.match(r'((?P<user>[^:]+)(:(?P<pass>.+))?@)?(?P<server>.+)',
                 specification)
             if m:
-                ssl = 0
-                if source == 'imaps':
-                    ssl = 1
+                ssl = source.endswith('s')
                 mailbox = ''
                 if len(args) > 3:
                     mailbox = args[3]

Roundup Issue Tracker: http://roundup-tracker.org/