diff roundup/mailgw.py @ 1547:f478c236b1f6

roundup mailgw now handles apop
author Richard Jones <richard@users.sourceforge.net>
date Mon, 24 Mar 2003 02:51:22 +0000
parents ed725179953d
children c36df13925f9
line wrap: on
line diff
--- a/roundup/mailgw.py	Sun Mar 23 09:37:20 2003 +0000
+++ b/roundup/mailgw.py	Mon Mar 24 02:51:22 2003 +0000
@@ -73,7 +73,7 @@
 an exception, the original message is bounced back to the sender with the
 explanatory message given in the exception. 
 
-$Id: mailgw.py,v 1.111 2003-02-27 05:43:01 richard Exp $
+$Id: mailgw.py,v 1.112 2003-03-24 02:51:21 richard Exp $
 '''
 
 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri
@@ -216,7 +216,12 @@
         fcntl.flock(f.fileno(), FCNTL.LOCK_UN)
         return 0
 
-    def do_pop(self, server, user='', password=''):
+    def do_apop(self, server, user='', password=''):
+        ''' Do authentication POP
+        '''
+        self.do_pop(server, user, password, apop=1):
+
+    def do_pop(self, server, user='', password='', apop=0):
         '''Read a series of messages from the specified POP server.
         '''
         import getpass, poplib, socket
@@ -236,8 +241,11 @@
         except socket.error, message:
             print "POP server error:", message
             return 1
-        server.user(user)
-        server.pass_(password)
+        if apop:
+            server.apop(user, password)
+        else:
+            server.user(user)
+            server.pass_(password)
         numMessages = len(server.list()[1])
         for i in range(1, numMessages+1):
             # retr: returns 

Roundup Issue Tracker: http://roundup-tracker.org/