Skip to content

Commit eb0a953

Browse files
author
Richard Jones
committed
Fixed [SF#479511]: mailgw to pop
once engelbert gruber tested the POPgateway.
1 parent e4f5c36 commit eb0a953

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

CHANGES.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ Feature:
1010
. Added CGI configuration via env vars (see roundup.cgi for details)
1111
. "roundup.cgi" is now installed to "<python-prefix>/share/roundup/cgi-bin"
1212
. roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
13-
. roundup-mailgw now supports unix mailbox as a source of mail. There's
14-
also POP support in there, but it's untested.
13+
. roundup-mailgw now supports unix mailbox and POP as sources of mail.
1514

1615
Fixed:
1716
. Fixed a bug in HTMLTemplate changes.
@@ -30,6 +29,7 @@ Fixed:
3029
. bug #477837 ] lynx does not like the cookie
3130
. bug #477892 ] Password edit doesn't fix login cookie
3231
. newuser_action now presents error messages rather than tracebacks.
32+
. bug #479511 ] mailgw to pop
3333

3434
2001-10-23 - 0.3.0 pre 3
3535
Feature:

roundup-mailgw

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: roundup-mailgw,v 1.12 2001-11-08 05:16:55 richard Exp $
19+
# $Id: roundup-mailgw,v 1.13 2001-11-09 01:05:55 richard Exp $
2020

21-
import sys, os, re
21+
import sys, os, re, cStringIO
2222
if int(sys.version[0]) < 2:
2323
print "Roundup requires Python 2.0 or newer."
2424
sys.exit(1)
@@ -73,11 +73,20 @@ def do_pop(handler, server, user='', password=''):
7373
server.user(user)
7474
server.pass_(password)
7575
numMessages = len(server.list()[1])
76-
for i in range(numMessages):
77-
for j in server.retr(i+1)[1]:
78-
s = cStringIO.StringIO('\n'.join(j))
79-
s.seek(0)
80-
handler.handle_Message(Message(s))
76+
for i in range(1, numMessages+1):
77+
# retr: returns
78+
# [ pop response e.g. '+OK 459 octets',
79+
# [ array of message lines ],
80+
# number of octets ]
81+
lines = server.retr(i)[1]
82+
s = cStringIO.StringIO('\n'.join(lines))
83+
s.seek(0)
84+
handler.handle_Message(Message(s))
85+
# delete the message
86+
server.dele(i)
87+
88+
# quit the server to commit changes.
89+
server.quit()
8190
return 0
8291

8392
def usage(args, message=None):
@@ -159,6 +168,10 @@ if __name__ == '__main__':
159168

160169
#
161170
# $Log: not supported by cvs2svn $
171+
# Revision 1.12 2001/11/08 05:16:55 richard
172+
# Rolled roundup-popgw into roundup-mailgw. Cleaned mailgw up significantly,
173+
# tested unix mailbox some more. POP still untested.
174+
#
162175
# Revision 1.11 2001/11/07 05:32:58 richard
163176
# More roundup-mailgw usage help.
164177
#

0 commit comments

Comments
 (0)