From: richard Date: Fri, 9 Nov 2001 01:05:55 +0000 (+0000) Subject: Fixed bug #479511 ] mailgw to pop once engelbert gruber tested the POP X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9460799e3572754fa140af22e577d681993a3823;p=roundup.git Fixed bug #479511 ] mailgw to pop once engelbert gruber tested the POP gateway. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@386 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/CHANGES.txt b/CHANGES.txt index d92a2e4..c79c3af 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -10,8 +10,7 @@ Feature: . Added CGI configuration via env vars (see roundup.cgi for details) . "roundup.cgi" is now installed to "/share/roundup/cgi-bin" . roundup-admin now accepts abbreviated commands (eg. l = li = lis = list) - . roundup-mailgw now supports unix mailbox as a source of mail. There's - also POP support in there, but it's untested. + . roundup-mailgw now supports unix mailbox and POP as sources of mail. Fixed: . Fixed a bug in HTMLTemplate changes. @@ -30,6 +29,7 @@ Fixed: . bug #477837 ] lynx does not like the cookie . bug #477892 ] Password edit doesn't fix login cookie . newuser_action now presents error messages rather than tracebacks. + . bug #479511 ] mailgw to pop 2001-10-23 - 0.3.0 pre 3 Feature: diff --git a/roundup-mailgw b/roundup-mailgw index f0342d3..e5a0b65 100755 --- a/roundup-mailgw +++ b/roundup-mailgw @@ -16,9 +16,9 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundup-mailgw,v 1.12 2001-11-08 05:16:55 richard Exp $ +# $Id: roundup-mailgw,v 1.13 2001-11-09 01:05:55 richard Exp $ -import sys, os, re +import sys, os, re, cStringIO if int(sys.version[0]) < 2: print "Roundup requires Python 2.0 or newer." sys.exit(1) @@ -73,11 +73,20 @@ def do_pop(handler, server, user='', password=''): server.user(user) server.pass_(password) numMessages = len(server.list()[1]) - for i in range(numMessages): - for j in server.retr(i+1)[1]: - s = cStringIO.StringIO('\n'.join(j)) - s.seek(0) - handler.handle_Message(Message(s)) + for i in range(1, numMessages+1): + # retr: returns + # [ pop response e.g. '+OK 459 octets', + # [ array of message lines ], + # number of octets ] + lines = server.retr(i)[1] + s = cStringIO.StringIO('\n'.join(lines)) + s.seek(0) + handler.handle_Message(Message(s)) + # delete the message + server.dele(i) + + # quit the server to commit changes. + server.quit() return 0 def usage(args, message=None): @@ -159,6 +168,10 @@ if __name__ == '__main__': # # $Log: not supported by cvs2svn $ +# Revision 1.12 2001/11/08 05:16:55 richard +# Rolled roundup-popgw into roundup-mailgw. Cleaned mailgw up significantly, +# tested unix mailbox some more. POP still untested. +# # Revision 1.11 2001/11/07 05:32:58 richard # More roundup-mailgw usage help. #