Skip to content

Commit cb4b4f2

Browse files
author
Richard Jones
committed
roundup mailgw now handles apop
1 parent 8db273c commit cb4b4f2

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Feature:
5151
- role names made case insensitive
5252
- added ability to restore retired nodes
5353
- more lenient date input and addition Interval input support (sf bug 677764)
54+
- roundup mailgw now handles apop
5455

5556

5657
Fixed:

roundup/mailgw.py

Lines changed: 12 additions & 4 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.111 2003-02-27 05:43:01 richard Exp $
76+
$Id: mailgw.py,v 1.112 2003-03-24 02:51:21 richard Exp $
7777
'''
7878

7979
import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri
@@ -216,7 +216,12 @@ def do_mailbox(self, filename):
216216
fcntl.flock(f.fileno(), FCNTL.LOCK_UN)
217217
return 0
218218

219-
def do_pop(self, server, user='', password=''):
219+
def do_apop(self, server, user='', password=''):
220+
''' Do authentication POP
221+
'''
222+
self.do_pop(server, user, password, apop=1):
223+
224+
def do_pop(self, server, user='', password='', apop=0):
220225
'''Read a series of messages from the specified POP server.
221226
'''
222227
import getpass, poplib, socket
@@ -236,8 +241,11 @@ def do_pop(self, server, user='', password=''):
236241
except socket.error, message:
237242
print "POP server error:", message
238243
return 1
239-
server.user(user)
240-
server.pass_(password)
244+
if apop:
245+
server.apop(user, password)
246+
else:
247+
server.user(user)
248+
server.pass_(password)
241249
numMessages = len(server.list()[1])
242250
for i in range(1, numMessages+1):
243251
# retr: returns

roundup/scripts/roundup_mailgw.py

Lines changed: 5 additions & 1 deletion
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.7 2003-01-12 00:03:11 richard Exp $
17+
# $Id: roundup_mailgw.py,v 1.8 2003-03-24 02:51:22 richard Exp $
1818

1919
# python version check
2020
from roundup import version_check
@@ -67,6 +67,10 @@ def usage(args, message=None):
6767
pop server
6868
are both valid. The username and/or password will be prompted for if
6969
not supplied on the command-line.
70+
71+
APOP:
72+
Same as POP, but using Authenticated POP
73+
7074
''')
7175
return 1
7276

0 commit comments

Comments
 (0)