Roundup Tracker - Issues

Issue 479511

classification
mailgw to pop
Type: Severity: normal
Components: Mail interface Versions:
process
Status: closed fixed
:
: richard : grubert, richard
Priority: normal :

Created on 2001-11-08 10:14 by grubert, last changed 2001-11-08 20:06 by richard.

Messages
msg69 Author: [hidden] (grubert) Date: 2001-11-08 10:14
only first line is fed into handler.
msg70 Author: [hidden] (grubert) Date: 2001-11-08 10:15
Logged In: YES 
user_id=147070

fighting with the upload
msg71 Author: [hidden] (grubert) Date: 2001-11-08 10:22
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):
msg72 Author: [hidden] (richard) Date: 2001-11-08 20:06
Logged In: YES 
user_id=6405

Great - I'll apply this patch when I get to work, thanks!
msg73 Author: [hidden] (richard) Date: 2001-11-09 01:06
Logged In: YES 
user_id=6405

Fixed in CVS, thanks!
History
Date User Action Args
2001-11-08 10:14:26grubertcreate