Skip to content

Commit 4a80a60

Browse files
author
Richard Jones
committed
*** empty log message ***
1 parent cb4b4f2 commit 4a80a60

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

roundup/mailgw.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class node. Any parts of other types are each stored in separate files
7373
an exception, the original message is bounced back to the sender with the
7474
explanatory message given in the exception.
7575
76-
$Id: mailgw.py,v 1.112 2003-03-24 02:51:21 richard Exp $
76+
$Id: mailgw.py,v 1.113 2003-03-24 02:54:35 richard Exp $
7777
'''
7878

7979
import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri
@@ -219,7 +219,7 @@ def do_mailbox(self, filename):
219219
def do_apop(self, server, user='', password=''):
220220
''' Do authentication POP
221221
'''
222-
self.do_pop(server, user, password, apop=1):
222+
self.do_pop(server, user, password, apop=1)
223223

224224
def do_pop(self, server, user='', password='', apop=0):
225225
'''Read a series of messages from the specified POP server.

roundup/scripts/roundup_mailgw.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1515
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1616
#
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 $
1818

1919
# python version check
2020
from roundup import version_check
@@ -69,7 +69,8 @@ def usage(args, message=None):
6969
not supplied on the command-line.
7070
7171
APOP:
72-
Same as POP, but using Authenticated POP
72+
Same as POP, but using Authenticated POP:
73+
apop username:password@server
7374
7475
''')
7576
return 1
@@ -122,8 +123,15 @@ def main(argv):
122123
return handler.do_pop(m.group('server'), m.group('user'),
123124
m.group('pass'))
124125
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'))
125133

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"'))
127135
finally:
128136
db.close()
129137

0 commit comments

Comments
 (0)