Mercurial > p > roundup > code
comparison roundup/scripts/roundup_mailgw.py @ 1548:c36df13925f9
*** empty log message ***
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 24 Mar 2003 02:56:30 +0000 |
| parents | f478c236b1f6 |
| children | 8b0bd0b897e6 |
comparison
equal
deleted
inserted
replaced
| 1547:f478c236b1f6 | 1548:c36df13925f9 |
|---|---|
| 12 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 12 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 13 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 13 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 14 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 14 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 15 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 15 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 16 # | 16 # |
| 17 # $Id: roundup_mailgw.py,v 1.8 2003-03-24 02:51:22 richard Exp $ | 17 # $Id: roundup_mailgw.py,v 1.9 2003-03-24 02:56:30 richard Exp $ |
| 18 | 18 |
| 19 # python version check | 19 # python version check |
| 20 from roundup import version_check | 20 from roundup import version_check |
| 21 | 21 |
| 22 import sys, os, re, cStringIO, getopt | 22 import sys, os, re, cStringIO, getopt |
| 67 pop server | 67 pop server |
| 68 are both valid. The username and/or password will be prompted for if | 68 are both valid. The username and/or password will be prompted for if |
| 69 not supplied on the command-line. | 69 not supplied on the command-line. |
| 70 | 70 |
| 71 APOP: | 71 APOP: |
| 72 Same as POP, but using Authenticated POP | 72 Same as POP, but using Authenticated POP: |
| 73 apop username:password@server | |
| 73 | 74 |
| 74 ''') | 75 ''') |
| 75 return 1 | 76 return 1 |
| 76 | 77 |
| 77 def main(argv): | 78 def main(argv): |
| 120 specification) | 121 specification) |
| 121 if m: | 122 if m: |
| 122 return handler.do_pop(m.group('server'), m.group('user'), | 123 return handler.do_pop(m.group('server'), m.group('user'), |
| 123 m.group('pass')) | 124 m.group('pass')) |
| 124 return usage(argv, _('Error: pop specification not valid')) | 125 return usage(argv, _('Error: pop specification not valid')) |
| 126 elif source == 'apop': | |
| 127 m = re.match(r'((?P<user>[^:]+)(:(?P<pass>.+))?@)?(?P<server>.+)', | |
| 128 specification) | |
| 129 if m: | |
| 130 return handler.do_apop(m.group('server'), m.group('user'), | |
| 131 m.group('pass')) | |
| 132 return usage(argv, _('Error: apop specification not valid')) | |
| 125 | 133 |
| 126 return usage(argv, _('Error: The source must be either "mailbox" or "pop"')) | 134 return usage(argv, _('Error: The source must be either "mailbox", "pop" or "apop"')) |
| 127 finally: | 135 finally: |
| 128 db.close() | 136 db.close() |
| 129 | 137 |
| 130 def run(): | 138 def run(): |
| 131 sys.exit(main(sys.argv)) | 139 sys.exit(main(sys.argv)) |
