Message71
Logged In: YES
user_id=147070
unified diff
Index: roundup-mailgw
===================================================================
RCS file: /cvsroot/roundup/roundup/roundup-mailgw,v
retrieving revision 1.12
diff -u -r1.12 roundup-mailgw
--- roundup-mailgw 2001/11/08 05:16:55 1.12
+++ roundup-mailgw 2001/11/08 10:04:55
@@ -24,6 +24,7 @@
sys.exit(1)
from mimetools import Message
+import cStringIO, string
def do_pipe(handler):
'''Read a message from standard input and pass it to the mail handler.
@@ -74,10 +75,19 @@
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))
+ # retr: returns
+ # [ pop response e.g. '+OK 459 octets',
+ # [ array of message lines ],
+ # number of octets ]
+ lns = server.retr(i+1)[1]
+ s = cStringIO.StringIO('\n'.join(lns))
+ s.seek(0)
+ handler.handle_Message(Message(s))
+ # maybe only delete on success
+ server.dele(i+1)
+
+ # quit the server to commit changes.
+ server.quit()
return 0
def usage(args, message=None):
|
|
Date |
User |
Action |
Args |
2009-02-03 14:19:58 | admin | link | issue479511 messages |
2009-02-03 14:19:58 | admin | create | |
|